matplotlib.pyplot中add_subplot方法参数的含义

ax = fig.add_subplot(349)
参数349的意思是:将画布分割成3行4列,图像画在从左到右从上到下的第9块
那第十块怎么办,3410是不行的,可以用另一种方式(3,4,10)。
fig = plt.figure()
ax = fig.add_subplot(2,1,1)
ax.plot(x,y)
ax = fig.add_subplot(2,2,3)#重新开始分区,并非从上一处开始
ax.plot(x,y)
plt.show()

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/rootkiss/article/details/88191336