0

Ive created a figure with 3 subplots. One of these is a seaborn countplot, the others are matplotlib plots.

The seaborn plot works if its on its own, or if there is no other plot after it in the figure, but if i add a figure after it, it becomes blank.

Any ideas why this might be? Below is an example with sample data. Thanks for any expertise provided.

fig = plt.figure(figsize=(12,6))
ax1 = fig.add_subplot(1,4,1)
ax2 = fig.add_subplot(1,4,2)
ax3 = fig.add_subplot(1,4,3)

fig.subplots_adjust(wspace = 0.6)

#...
#...

ax1.bar(d.index, bar_heights, color = my_colors)
ax1.set_title("ax1")

ax2 = sns.countplot(x="Survived",data= raw_dataset)
ax2.set_title("ax2")

raw_dataset["Survived"].value_counts().plot(ax=ax3, kind="bar")
ax3.set_title("ax3")

plt.show()

enter image description here

wilson_smyth
  • 1,202
  • 1
  • 14
  • 39

0 Answers0