-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add examples to customize 2D KDE (#1158)
* add examples to customize 2D KDE * blackify gallery example * update changelog * briefly explain contour_kwargs and contourf_kwargs
- Loading branch information
1 parent
7f46107
commit 6a51574
Showing
3 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
2d KDE | ||
====== | ||
_thumb: .1, .8 | ||
""" | ||
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() |