Paired Density and Scatterplot MatrixΒΆ

../_images/pair_grid_with_kde.png

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

import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white")

df = sns.load_dataset("iris")

g = sns.PairGrid(df, diag_sharey=False)
g.map_lower(sns.kdeplot, cmap="Blues_d")
g.map_upper(plt.scatter)
g.map_diag(sns.kdeplot, lw=3)