如何在每个子图下方添加空格?[复制]

How can I add space below each subplot? [duplicate]

提问人:Retr0spective 提问时间:11/17/2023 最后编辑:Trenton McKinneyRetr0spective 更新时间:11/17/2023 访问量:30

问:

我希望输出一个带有 3 个子图的图形,并在每个子图下方包含一些相关文本。我无法适当地间隔我的子图。

我试过:

gs = gridspec.GridSpec(6, 1, height_ratios=[1, 0.2, 1, 0.2, 1, 0.2])
ax1 = fig.add_subplot(gs[0])
ax2 = fig.add_subplot(gs[2])
ax3 = fig.add_subplot(gs[4])

Matplotlib 似乎忽略了第 6 行,因为它没有分配给子图。因此,前 2 个子图下方有空间,但第三个子图下方没有空间。

我也尝试过使用和调整,但无济于事。plt.subplots_adjust()hspacebottom

我不清楚 GridSpec()/subplots_adjust() 的“底部”参数在控制什么。我希望澄清一下。

python matplotlib 子图 matplotlib-gridspec

评论


答: 暂无答案