matplotlib.pyplot显示若干秒后自动关闭

matplotlib.pyplot显示若干秒后自动关闭

import matplotlib.pyplot as plt

import numpy as np

file=r"D:py_machine_learnhandwriting.png"

img=plt.imread(file)

plt.set_cmap("gray")

plt.imshow(img)

plt.ion()

plt.pause(1)

plt.close()

# plt.show()

 

原文地址:https://www.cnblogs.com/xiexiaokui/p/12616326.html