.. _sphx_glr_gallery_event_handling:
.. _event_handling_examples:
Event handling
==============
Matplotlib supports :doc:`event handling` with
a GUI neutral event model, so you can connect to Matplotlib events without
knowledge of what user interface Matplotlib will ultimately be plugged in to.
This has two advantages: the code you write will be more portable, and
Matplotlib events are aware of things like data coordinate space and which
axes the event occurs in so you don't have to mess with low level
transformation details to go from canvas space to data space. Object picking
examples are also included.
.. raw:: html
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_close_event_thumb.png
:alt: Close Event
:ref:`sphx_glr_gallery_event_handling_close_event.py`
.. raw:: html
Close Event
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_coords_demo_thumb.png
:alt: Mouse move and click events
:ref:`sphx_glr_gallery_event_handling_coords_demo.py`
.. raw:: html
Mouse move and click events
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_cursor_demo_thumb.png
:alt: Cross hair cursor
:ref:`sphx_glr_gallery_event_handling_cursor_demo.py`
.. raw:: html
Cross hair cursor
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_data_browser_thumb.png
:alt: Data Browser
:ref:`sphx_glr_gallery_event_handling_data_browser.py`
.. raw:: html
Data Browser
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_figure_axes_enter_leave_thumb.png
:alt: Figure/Axes enter and leave events
:ref:`sphx_glr_gallery_event_handling_figure_axes_enter_leave.py`
.. raw:: html
Figure/Axes enter and leave events
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_ginput_manual_clabel_sgskip_thumb.png
:alt: Interactive functions
:ref:`sphx_glr_gallery_event_handling_ginput_manual_clabel_sgskip.py`
.. raw:: html
Interactive functions
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_image_slices_viewer_thumb.png
:alt: Image Slices Viewer
:ref:`sphx_glr_gallery_event_handling_image_slices_viewer.py`
.. raw:: html
Image Slices Viewer
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_keypress_demo_thumb.png
:alt: Keypress event
:ref:`sphx_glr_gallery_event_handling_keypress_demo.py`
.. raw:: html
Keypress event
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_lasso_demo_thumb.png
:alt: Lasso Demo
:ref:`sphx_glr_gallery_event_handling_lasso_demo.py`
.. raw:: html
Lasso Demo
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_legend_picking_thumb.png
:alt: Legend Picking
:ref:`sphx_glr_gallery_event_handling_legend_picking.py`
.. raw:: html
Legend Picking
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_looking_glass_thumb.png
:alt: Looking Glass
:ref:`sphx_glr_gallery_event_handling_looking_glass.py`
.. raw:: html
Looking Glass
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_path_editor_thumb.png
:alt: Path Editor
:ref:`sphx_glr_gallery_event_handling_path_editor.py`
.. raw:: html
Path Editor
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_pick_event_demo_thumb.png
:alt: Pick Event Demo
:ref:`sphx_glr_gallery_event_handling_pick_event_demo.py`
.. raw:: html
Pick Event Demo
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_pick_event_demo2_thumb.png
:alt: Pick Event Demo2
:ref:`sphx_glr_gallery_event_handling_pick_event_demo2.py`
.. raw:: html
Pick Event Demo2
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_poly_editor_thumb.png
:alt: Poly Editor
:ref:`sphx_glr_gallery_event_handling_poly_editor.py`
.. raw:: html
Poly Editor
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_pong_sgskip_thumb.png
:alt: Pong
:ref:`sphx_glr_gallery_event_handling_pong_sgskip.py`
.. raw:: html
Pong
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_resample_thumb.png
:alt: Resampling Data
:ref:`sphx_glr_gallery_event_handling_resample.py`
.. raw:: html
Resampling Data
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_timers_thumb.png
:alt: Timers
:ref:`sphx_glr_gallery_event_handling_timers.py`
.. raw:: html
Timers
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_trifinder_event_demo_thumb.png
:alt: Trifinder Event Demo
:ref:`sphx_glr_gallery_event_handling_trifinder_event_demo.py`
.. raw:: html
Trifinder Event Demo
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_viewlims_thumb.png
:alt: Viewlims
:ref:`sphx_glr_gallery_event_handling_viewlims.py`
.. raw:: html
Viewlims
.. raw:: html
.. only:: html
.. image:: /gallery/event_handling/images/thumb/sphx_glr_zoom_window_thumb.png
:alt: Zoom Window
:ref:`sphx_glr_gallery_event_handling_zoom_window.py`
.. raw:: html
Zoom Window
.. raw:: html
.. toctree::
:hidden:
/gallery/event_handling/close_event
/gallery/event_handling/coords_demo
/gallery/event_handling/cursor_demo
/gallery/event_handling/data_browser
/gallery/event_handling/figure_axes_enter_leave
/gallery/event_handling/ginput_manual_clabel_sgskip
/gallery/event_handling/image_slices_viewer
/gallery/event_handling/keypress_demo
/gallery/event_handling/lasso_demo
/gallery/event_handling/legend_picking
/gallery/event_handling/looking_glass
/gallery/event_handling/path_editor
/gallery/event_handling/pick_event_demo
/gallery/event_handling/pick_event_demo2
/gallery/event_handling/poly_editor
/gallery/event_handling/pong_sgskip
/gallery/event_handling/resample
/gallery/event_handling/timers
/gallery/event_handling/trifinder_event_demo
/gallery/event_handling/viewlims
/gallery/event_handling/zoom_window