### Navigation

- index
- modules |
- home|
- examples|
- tutorials|
- pyplot|
- docs »

# Close Event

    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()

Total running time of the script: ( 0 minutes 0.032 seconds)

Generated by Sphinx-Gallery