关闭事件下载这个示例关闭事件显示图形关闭时发生的连接事件的示例。 import matplotlib.pyplot as pltdef handle_close(evt): print('Closed Figure!')fig = plt.figure()fig.canvas.mpl_connect('close_event', handle_close)plt.text(0.35, 0.5, 'Close Me!', dict(size=30))plt.show() 下载这个示例 下载python源码: close_event.py下载Jupyter notebook: close_event.ipynb