matplotlib使用GridSpec调整子图位置大小 (非对称的子图)
参考用matplotlib.pyplot的subplots命令可以很方便的画对称的子图,但是如果要画非对称的子图(如下)就需要用GridSpec命令来控制子图的位置和大小:import matplotlib.pyplot as pltfrom matplotlib.gridspec import GridSpecfig = plt.figure(1)gs = GridSpec(3, 3)ax1 = plt.subplot(gs[0, :])ax2 = plt.subplot(gs[1,
原创
2020-11-05 17:28:27 ·
1104 阅读 ·
0 评论