-1

I was trying to create visualize a variable using sns.distplot() and sns.boxplot()

the code

I got this result:

result

Apparently,first subplot is skipped.Does anyone know why this is happening?

1 Answers1

1

The reason you are seeing the displot outside is because it is a figure-level function and you cannot use ax in it. You can change it to histplot and should see it working...

fig, axes = plt.subplots(2,1,figsize=(5,5))
sns.histplot(wine['fixed acidity'], ax=axes[0])
sns.boxplot(wine['fixed acidity'], ax=axes[1])

Plot

enter image description here

Redox
  • 9,321
  • 5
  • 9
  • 26