Matplotlib 移除白边

桑弧蓬矢射四方 at 
前言需求很简单就是需要在 Python 的做图中,生成的图片都是不含白边的。参考这个帖子解决了问题,Removing white space around a saved image in matplotlib。发现最有效的答案不是高分那个,那个答案还是需设置才行。但是后面的答案还是更加有效。plt.axis("off")fig=plt.imshow(image array,interpolation='nearest')fig.axes.get_xaxis().set_visible(False)fig.axes.get_yaxis().set_visible(False)plt.savef……