||
matplotlib 标签超出画布
可在保存图片之前加入这一句:
plt.tight_layout()
参考原文:http://matplotlib.org/users/tight_layout_guide.html
示例图1:
To prevent this, the location of axes needs to be adjusted. For subplots, this can be done by adjusting the subplot params (Move the edge of an axes to make room for tick labels). Matplotlib v1.1 introduces a new command tight_layout() that does this automatically for you.
示例图2
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-24 06:39
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社