【发布时间】:2021-06-27 00:40:33
【问题描述】:
f = plt.figure(figsize=(12,10))
ax1 = f.add_subplot(411)
ax2 = f.add_subplot(422)
ax3 = f.add_subplot(423)
ax4 = f.add_subplot(424)
ax5 = f.add_subplot(425)
ax6 = f.add_subplot(426)
ax7 = f.add_subplot(427)
ax8 = f.add_subplot(428)
我想增加两行之间的空间:ax1 和 ax2-ax3。其他空间应保持不变。使用“f.subplots_adjust(hspace = 0.2, wspace= 0.25)”调整所有子图的间距。我该怎么做才能只增加最顶层子图的 hspace?
【问题讨论】:
-
一个技巧是在ax2的标题上加一个空格,即ax2.set_title(“”),然后使用constrained_layout
标签: matplotlib subplot