2d KDE (custom style)ΒΆ

API documentation: plot_kde()

../_images/mpl_plot_kde_2d_bis.png

Python source code: [download source: matplotlib/mpl_plot_kde_2d_bis.py]

import matplotlib.pyplot as plt
import numpy as np

import arviz as az

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

az.plot_kde(
    np.random.beta(2, 5, size=100),
    np.random.beta(2, 5, size=100),
    contour_kwargs={"colors": None, "cmap": plt.cm.viridis, "levels": 30},
    contourf_kwargs={"alpha": 0.5, "levels": 30},
)

plt.show()

Python source code: [download source: bokeh/bokeh_plot_kde_2d_bis.py]

import numpy as np

import arviz as az

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

az.plot_kde(
    np.random.beta(2, 5, size=100),
    np.random.beta(2, 5, size=100),
    contour_kwargs={"levels": 30},
    contourf_kwargs={"alpha": 0.5, "levels": 30, "cmap": "viridis"},
    backend="bokeh",
)