Matplotlib图在复活后没有关闭

时间:2016-02-09 19:45:12

标签: python matplotlib figure

请尝试以下代码:

import matplotlib.pyplot as plt
fig = plt.figure() #creates a pyplot figure
plt.close(fig) #closes the figure
fig.show() #resurrects the figure, that is, displays it
plt.close(fig) #should close the figure, but does nothing

我的问题是:

  1. 为什么最后一行代码没有关闭图?

  2. 如何以上述方式重新启动数字后以编程方式关闭数字?

0 个答案:

没有答案