.. _book_fig_chapter5_fig_hist_binsize: Selection of Histogram bin size ------------------------------- Figure 5.20 The results of Scott's rule, the Freedman-Diaconis rule, and Knuth's rule for selecting the optimal bin width for a histogram. These histograms are based on 5000 points drawn from the shown pdfs. On the left is a simple normal distribution. On the right is a Laplacian distribution at the center, with two small Gaussian peaks added in the wings. .. image:: ../images/chapter5/fig_hist_binsize_1.png :scale: 100 :align: center .. raw:: html
**Code output:** .. raw:: html
.. literalinclude:: fig_hist_binsize.txt .. raw:: html
**Python source code:** .. raw:: html
.. literalinclude:: fig_hist_binsize.py :lines: 12- .. raw:: html
:download:`[download source: fig_hist_binsize.py] ` .. raw:: html