You are reading an old version of the documentation (v2.0.0). For the latest version see


This Page

style_sheets example code: plot_bmh.pyΒΆ

(Source code, png, pdf)

Bayesian Methods for Hackers style sheet

This example demonstrates the style used in the Bayesian Methods for Hackers
[1]_ online book.

.. [1]

from numpy.random import beta
import matplotlib.pyplot as plt'bmh')

def plot_beta_hist(ax, a, b):
    ax.hist(beta(a, b, size=10000), histtype="stepfilled",
            bins=25, alpha=0.8, normed=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")

Keywords: python, matplotlib, pylab, example, codex (see Search examples)