简体   繁体   English

子图是重叠的轴标签

[英]subplots are overlapping axis labels

I have created a figure in python which contains multiple subplots. 我在python中创建了一个包含多个子图的图形。 I have also added various axis labels to some of the axes on the figures. 我还在图中的某些轴上添加了各种轴标签。 For examples: 举些例子:

plt.xlabel('Phase ($^\circ$)',fontsize=10)

I notice though, that when the final figure is produced, the other subplots are allowed to overlap and obscure the words of the axis labels. 我注意到,当生成最终图形时,允许其他子图重叠并遮盖轴标签的单词。

Is there a way that I can stop this happening? 有没有办法可以阻止这种情况发生?

just add the following: 只需添加以下内容:

plt.tight_layout()

I hope it helps. 我希望它有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM