python 使用plt畫圖,去除圖片四周的白邊

用matplotlib.pyplot畫的圖,顯示和保存的圖片周圍都會有白邊,可以去掉。爲了顯示的更清楚,給圖片加了紅色的框 代碼 「` import matplotlib.pyplot as plt fig, ax = plt.subplots() im = im[:, :, (2, 1, 0)] ax.imshow(im, aspect=’equal’) plt.axis(‘off’) # 去除
相關文章
相關標籤/搜索