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.
参考
数学是符号的艺术,音乐是上界的语言。