Reputation: 23
I'm ploting a pairplot plot with seaborn (See figure). I would like to add to the histograms the KDE estimations. Is it possible? Besides, is it possible to make the histogram less opaque in order to better see both of them? Thank you
Upvotes: 1
Views: 443
Reputation: 91
If I understand correctly, this might address your requirements
import seaborn as sns
sns.set(style="ticks")
df = sns.load_dataset("iris")
p = sns.PairGrid(df, vars=['sepal_length', 'sepal_width'], hue="species")
p = p.map_offdiag(sns.scatterplot)
p = p.map_diag(sns.distplot, hist=True, kde=True, hist_kws={'alpha':0.5})
Here is the screenshot..
Upvotes: 2