mirror of
https://github.com/Estom/notes.git
synced 2026-02-07 20:44:38 +08:00
610 B
610 B
关闭事件
显示图形关闭时发生的连接事件的示例。
import matplotlib.pyplot as plt
def 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()
