您的位置:首页 > 编程语言 > Python开发

Python:解决Matplotlib保存图片显示不全问题

2022-05-19 11:20 1531 查看

保存图片的时候设置参数

bbox_inches = 'tight'
,如:

plt.savefig("Matplotlib/graph.png", bbox_inches = 'tight')

以下是bbox_inches参数介绍:

bbox_inches:  str or Bbox, default: rcParams["savefig.bbox"] (default: None)

Bounding box in inches: only the given portion of the figure is saved. If 'tight', try to figure out the tight bbox of the figure.

参考

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: