[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../gallery/misc/../mplot3d/../style_sheets/bmh.html [Back]  [Original]

Bayesian Methods for Hackers style sheet — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

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/

'bmh' style sheet ['bmh' style sheet]
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()

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page