Matplotlib保存文件

参数名 参数意义
bbox_inches 去掉图片内的空白
pad_inches 去掉图片和文件边界的空白
# 这个指令可以保存成没有外边框,没有内边框的图片格式,也可以是pdf文件。
plt.savefig('merged_images.jpg', bbox_inches='tight', dpi=300, pad_inches=0.0)

包含bbox_inches和pad_inches参数
image
仅包含bbox_inches参数
image
仅包含pad_inches参数
image
所有参数都不包含
image

posted on 2024-01-09 19:56  蔚蓝色の天空  阅读(3)  评论(0编辑  收藏  举报