
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/style_sheets/bmh.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. meta::
        :keywords: codex

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_gallery_style_sheets_bmh.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _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/

.. GENERATED FROM PYTHON SOURCE LINES 12-34



.. image-sg:: /gallery/style_sheets/images/sphx_glr_bmh_001.png
   :alt: 'bmh' style sheet
   :srcset: /gallery/style_sheets/images/sphx_glr_bmh_001.png, /gallery/style_sheets/images/sphx_glr_bmh_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. code-block:: Python

    import matplotlib.pyplot as plt
    import numpy as np

    # Fixing random state for reproducibility
    np.random.seed(19680801)

    plt.style.use('bmh')


    def plot_beta_hist(ax, a, b):
        ax.hist(np.random.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()


.. _sphx_glr_download_gallery_style_sheets_bmh.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: bmh.ipynb <bmh.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: bmh.py <bmh.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: bmh.zip <bmh.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
