plt.subplot(总行数,总列数,序号)
x=np.arange(0,7,0.1) y1=np.sin(x) y2=np.cos(x) y3=2*x+6 y4=-2*x+9 plt.subplot(2,2,1) plt.plot(x,y1) plt.subplot(2,2,4) plt.plot(x,y2) plt.subplot(2,2,3) plt.plot(x,y3) plt.subplot(2,2,2) plt.plot(x,y4) plt.show()
plt.subplot(总行数,总列数,序号)
x=np.arange(0,7,0.1) y1=np.sin(x) y2=np.cos(x) y3=2*x+6 y4=-2*x+9 plt.subplot(2,2,1) plt.plot(x,y1) plt.subplot(2,2,4) plt.plot(x,y2) plt.subplot(2,2,3) plt.plot(x,y3) plt.subplot(2,2,2) plt.plot(x,y4) plt.show()