2D histogram

2D histogram#

Use a two-dimensional histogram when a scatter plot is too dense.

Matplotlib version of plot_pair_histogram2d

Link to this page with the bokeh tab selected

Link to this page with the plotly tab selected

from arviz_base import load_arviz_data

import arviz_plots as azp

azp.style.use("arviz-variat")

data = load_arviz_data("centered_eight")
pc = azp.plot_pair(
    data,
    var_names=["theta", "tau"],
    coords={"school": ["Lawrenceville", "Mt. Hermon"]},
    visuals={"scatter": False, "histogram2d": True},
    stats={"histogram2d": {"bins": 20}},
    marginal=True,
    backend="none",  # change to preferred backend
)
pc.show()

See also

API Documentation: plot_pair

Other examples with plot_pair#