使用 plt.close() 关闭特定数字
可以通过保持其手柄来关闭特定图形
import matplotlib.pyplot as plt
fig1 = plt.figure() # create first figure
plt.plot([0, 1], [0, 1])
fig2 = plt.figure() # create second figure
plt.plot([0, 1], [0, 1])
plt.close(fig1) # close first figure although second one is active