使用 pyplot 关闭当前活动数字

matplotlib 的 pyplot 接口可能是关闭数字的最简单方法。

import matplotlib.pyplot as plt
plt.plot([0, 1], [0, 1])
plt.close()