![](/img/trans.png)
[英]How to adjust space between every second row of subplots in matplotlib
[英]Adjust the distance only between two subplots in matplotlib
我有3個子圖(3行1列)。 我們可以使用fig.subplots_adjust(hspace=0.2)
來調整子圖之間的距離。 這將改變所有情況下子圖之間的距離。 如何在圖1(311)和圖2(312)以及圖2(312)和圖3(313)之間有不同的距離?
好問題。 嘗試這個:
from mpl_toolkits.axes_grid1 import make_axes_locatable
ax1 = plt.subplot2grid((1,1), (0,0))
divider = make_axes_locatable(ax1)
ax2 = divider.append_axes("bottom", size="100%", pad=0.5)
ax3 = divider.append_axes("bottom", size="100%", pad=1)
然后你會得到:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.