|
|
event_handling_Examples 01_close_event. |
H.Kamifuji . |
from __future__ import print_function 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() |
![]() 閉じた時に、コンソールに、下記のように表示されます。 Closed Figure! |
event_handling_Examples code: close_event.py |
|