编程语言
首页 > 编程语言> > Python:解决Matplotlib保存图片显示不全问题

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

作者:互联网

保存图片的时候设置参数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.

参考

标签:figure,inches,Python,不全,Matplotlib,tight,bbox,savefig
来源: https://www.cnblogs.com/orion-orion/p/16287851.html