matplotlib 的 subplot 还可以是分格的,这里介绍三种方法.
subplot2grid
使用import导入matplotlib.pyplot模块, 并简写成plt. 使用plt.figure()创建一个图像窗口
import matplotlib.pyplot as plt
plt.figure()
使用plt.subplot2grid来创建第1个小图, (3,3)表示将整个图像窗口分成3行3列, (0,0)表示从第0行第0列开始作图,colspan=3表示列的跨度为3, rowspan=1表示行的跨度为1. colspan和rowspan缺省, 默认跨度为1.
ax1 = plt.subplot2grid((3, 3