解决办法:
plt.savefig(save_img_path, bbox_inches=‘tight’, pad_inches=0) # 保存图像
plt.savefig保存的图像存在白边的问题
最新推荐文章于 2024-05-01 11:00:00 发布
本文介绍了如何在使用Python的matplotlib库时,通过调整`bbox_inches`和`pad_inches`参数来优化图像保存,确保图像边界紧贴且无额外空白。
摘要由CSDN通过智能技术生成