.. _sphx_glr_gallery_style_sheets_bmh.py: ======================================== Bayesian Methods for Hackers style sheet ======================================== This example demonstrates the style used in the Bayesian Methods for Hackers [1]_ online book. .. [1] http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/ .. image:: /gallery/style_sheets/images/sphx_glr_bmh_001.png :align: center .. code-block:: python from numpy.random import beta import matplotlib.pyplot as plt plt.style.use('bmh') def plot_beta_hist(ax, a, b): ax.hist(beta(a, b, size=10000), histtype="stepfilled", bins=25, alpha=0.8, density=True) fig, ax = plt.subplots() plot_beta_hist(ax, 10, 10) plot_beta_hist(ax, 4, 12) plot_beta_hist(ax, 50, 12) plot_beta_hist(ax, 6, 55) ax.set_title("'bmh' style sheet") plt.show() .. only :: html .. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download Python source code: bmh.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: bmh.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_