How to choose bins in matplotlib histogram

后端 未结 4 1732
遥遥无期
遥遥无期 2020-12-22 20:30

Can someone explain to me what \"bins\" in histogram are (the matplotlib hist function)? And assuming I need to plot the probability density function of some data, how do th

4条回答
  •  情深已故
    2020-12-22 20:49

    To complemented jakes answer, you can use numpy.histogram_bin_edges if you just want to calculate the optimal bin edges, without actually doing the histogram. histogram_bin_edges is a function specifically designed for the optimal calculation of bin edges. You can choose seven different algorithms for the optimisation.

提交回复
热议问题