0

I try to use matplotlib.pyplot,subplots to show some figuers but the position of the figuers are not right, they always pile up on the last subfiguer, I don't know why. Here is my code.

fig,(ax1,ax2,ax3,ax4)=plt.subplots(1,4,figsize=(20,5))
ax1=plt.scatter(SenRev(data1959)[:,0],SenRev(data1959)[:,1])
ax2=plt.scatter(SenRev(data1979)[:,0],SenRev(data1979)[:,1])
ax3=plt.scatter(SenRev(data1999)[:,0],SenRev(data1999)[:,1])
ax4=plt.scatter(SenRev(data2019)[:,0],SenRev(data2019)[:,1])

enter image description here

Ch3steR
  • 20,090
  • 4
  • 28
  • 58
HerneS
  • 1

1 Answers1

2

Call the scatter method on each of the axes

ax1.scatter(SenRev(data1959)[:,0],SenRev(data1959)[:,1])
ax2.scatter(SenRev(data1979)[:,0],SenRev(data1979)[:,1])
ax3.scatter(SenRev(data1999)[:,0],SenRev(data1999)[:,1])
ax4.scatter(SenRev(data2019)[:,0],SenRev(data2019)[:,1])
Riley
  • 2,153
  • 1
  • 6
  • 16