Paired density and scatterplot matrixΒΆ

../_images/pair_grid_with_kde.png

seaborn components used: set_theme(), load_dataset(), PairGrid

import seaborn as sns
sns.set_theme(style="white")

df = sns.load_dataset("penguins")

g = sns.PairGrid(df, diag_sharey=False)
g.map_upper(sns.scatterplot, s=15)
g.map_lower(sns.kdeplot)
g.map_diag(sns.kdeplot, lw=2)