Dist PlotΒΆ

../../_images/mpl_plot_dist.png

Python source code: [download source: mpl_plot_dist.py]

API documentation: plot_dist()

import matplotlib.pyplot as plt
import numpy as np

import arviz as az

az.style.use("arviz-darkgrid")

a = np.random.poisson(4, 1000)
b = np.random.normal(0, 1, 1000)

_, ax = plt.subplots(1, 2, figsize=(10, 4))
az.plot_dist(a, color="C1", label="Poisson", ax=ax[0])
az.plot_dist(b, color="C2", label="Gaussian", ax=ax[1])

plt.show()