0

I would like to create a row with 3 plots with seaborn displot, but now they appear one under another. I've tried to use the following code:

f, axes = plt.subplots(ncols=3, figsize=(15, 6))

which worked while using seaborn distplot, but here it only shows empty axes without plots. My code:

sns.displot(df.col1, kde = True, height =3)
sns.displot(df.col2, kde = True, height =3)
sns.displot(df.col3, kde = True, height =3)
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
user4t48u
  • 31
  • 4
  • 2
    Use [`kdeplot`](https://seaborn.pydata.org/generated/seaborn.kdeplot.html#seaborn.kdeplot), since `displot` is a figure-level interface? – BigBen Apr 24 '23 at 18:13
  • 1
    `df = df.melt()` and `g = sns.displot(data=df, x='value', col='variable', kde=True)` – Trenton McKinney Apr 24 '23 at 19:12

0 Answers0