python - 使用奇数图表时,将最后一个matplotlib子图图表居中

标签 python matplotlib charts subplot

如果我有5张图表,如果我制作了3x2子图,如何将最后一张(第5张)图表居中?

这是我当前的代码:

plt.figure(1)

plt.subplot(321)
firstperiod.megaball.plot(kind='hist', bins = 25)

plt.subplot(322)
secondperiod.megaball.plot(kind='hist', bins = 36)

plt.subplot(323)
thirdperiod.megaball.plot(kind='hist', bins = 52)

plt.subplot(324)
fourthperiod.megaball.plot(kind='hist', bins = 46)

plt.subplot(325)
fifthperiod.megaball.plot(kind='hist', bins = 15)


还想在图表之间放置更多的空格,以使轴值不会局促和重叠。.是否还有其他选择?

最佳答案

要使第5个子图居中,请参见此answer

有关白间距,请参见此answer

关于python - 使用奇数图表时,将最后一个matplotlib子图图表居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30635255/

相关文章:

python - 如何制作一个数据透视表,其中的值按索引排列在行中

python - 如何使用 matplotlib 将 det unix 时间值从 txt 文件转换为日期值?

python : Cannot save plots as png

matlab - 我怎样才能在 MATLAB 中只显示图例

javascript - 使用分布曲线创建直方图,其中曲线系列大于 bin 系列

Python Pandas : conditional subtraction

python - 为什么我不能 "string".print()?

python - 了解 xarray groupby

python - 如何按周和年绘制时间序列数据?

swift - IOS 图表/MPAndroidChart。轴高