3.1多合一
plt.figure()
plt.subplot(2, 2, 1) #分成2行2列 在第一个位置画(左上位置)
#plt.plot([0,0],[0,1])
plt.subplot(222) #第二个位置画
plt.plot([0, 1], [0, 2])
plt.subplot(223) #第三个位置画
plt.subplot(223)
plt.subplot(224) #第四个位置画
plt.plot([0, 1], [0, 4])
plt.show()
3.2 分格显示
好多种方法,我只记录一种就好了
比上一种方法好理解 上一种方法【画上面一个图 下面多个图】的时候 不好理解
ax1 = plt.subplot2grid((3, 3), (0, 0), colspan=3)
# (3,3)代表3行三列 (0,0)代表第0行第0列
# colspan