matplotlib调整子图布局
画图时经常遇到这种情况
或者这种,反正都是挡住一部分
经过一顿百度,找到了这个函数
matplotlib.pyplot.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)
left, bottom, right, top控制子图所在区域,wspace, hspace控制子图之间的距离
官方链接:https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots_adjust.html
画一个图点击这个按钮就可以找到这几个参数,然后进行调整就可以了
点击后会弹出这样的窗口,我们可以进行调整,如何记下后面的数字
当把left参数调整到0.2时我们的字就出来了(要调整其他位置同理)
然后在画图时插入
plt.subplots_adjust(left=0.2)
就就就完事了
Way cool! Some very valid points! I appreciate you penning this post plus the rest of the website is also very good. Leoline Rudd Templeton