plt.figure()令frameon=False就可以去掉邊框
import imageio
import matplotlib.pyplot as plt
png=imageio.imread('D:/Data/Mnist/picture/mnist_2.png')
plt.figure(figsize=(4,4),frameon=False)
plt.imshow(png,cmap='gray')
plt.title('png')
plt.show()
效果:
參考博客:https://blog.csdn.net/m0_37362454/article/details/81511427