Posterior Plot (reducing school dimension)#
API documentation: plot_posterior()
Python source code: [download source: matplotlib/mpl_plot_posterior_combinedims.py]
import matplotlib.pyplot as plt
import arviz as az
az.style.use("arviz-darkgrid")
data = az.load_arviz_data("centered_eight")
coords = {"school": ["Choate", "Mt. Hermon", "Deerfield"]}
az.plot_posterior(data, var_names=["mu", "theta"], combine_dims={"school"}, coords=coords)
plt.show()
Python source code: [download source: bokeh/bokeh_plot_posterior_combinedims.py]
import arviz as az
data = az.load_arviz_data("centered_eight")
coords = {"school": ["Choate", "Mt. Hermon", "Deerfield"]}
ax = az.plot_posterior(
data,
var_names=["mu", "theta"],
combine_dims={"school"},
coords=coords,
backend="bokeh",
)