:orphan:

.. _examples:

:mod:`mplcursors` examples
==========================

As `mplcursors` is fundamentally a library for interactivity, you should
download the examples and try them yourself :-)

.. vim: ft=rst



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="... is to add interactive data cursors to a figure. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_basic_thumb.png

        :ref:`sphx_glr_examples_basic.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/basic

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When ``hover`` is set to ``True``, annotations are displayed when the mouse hovers over the art...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_hover_thumb.png

        :ref:`sphx_glr_examples_hover.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/hover

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use an event handler to customize the popup. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_change_popup_color_thumb.png

        :ref:`sphx_glr_examples_change_popup_color.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/change_popup_color

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Contour plot support is limited to picking the individual :class:`~matplotlib.collections.LineC...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_contour_thumb.png

        :ref:`sphx_glr_examples_contour.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/contour

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="... display the underlying data value. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_image_thumb.png

        :ref:`sphx_glr_examples_image.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/image

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="mplcursors correctly formats datetime data. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_date_thumb.png

        :ref:`sphx_glr_examples_date.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/date

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using an event handler to change the annotation text and position. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_bar_thumb.png

        :ref:`sphx_glr_examples_bar.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/bar

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use an event handler to change the annotation text. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_artist_labels_thumb.png

        :ref:`sphx_glr_examples_artist_labels.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/artist_labels

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="mpldatacursor&#x27;s ``point_labels`` functionality can be emulated with an event handler that sets ...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_labeled_points_thumb.png

        :ref:`sphx_glr_examples_labeled_points.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/labeled_points

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=":class:`~pandas.DataFrame`\s can be used similarly to any other kind of input. Here, we generat...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_dataframe_thumb.png

        :ref:`sphx_glr_examples_dataframe.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/dataframe

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Just pass ``highlight=True`` to `cursor`. ">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_highlight_thumb.png

        :ref:`sphx_glr_examples_highlight.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/highlight

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="By default, mplcursors uses &quot;t&quot; to toggle interactivity and &quot;d&quot; to hide/show annotation boxes. ...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_keyboard_shortcuts_thumb.png

        :ref:`sphx_glr_examples_keyboard_shortcuts.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/keyboard_shortcuts

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of connecting to cursor events: when an artist is selected, also highlight its &quot;part...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_paired_highlight_thumb.png

        :ref:`sphx_glr_examples_paired_highlight.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/paired_highlight

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="... as opposed to lines with a ``&quot;.&quot;`` style, which have the same appearance, but are highlight...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_scatter_thumb.png

        :ref:`sphx_glr_examples_scatter.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/scatter

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A selection on a step plot holds precise information on the x and y position in the ``sel.targe...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_step_thumb.png

        :ref:`sphx_glr_examples_step.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/step

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="By default, each `Cursor` will ever display one annotation at a time.  Pass ``multiple=True`` t...">

.. only:: html

    .. figure:: /examples/images/thumb/sphx_glr_nondraggable_thumb.png

        :ref:`sphx_glr_examples_nondraggable.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/nondraggable
.. raw:: html

    <div style='clear:both'></div>



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

    :download:`Download all examples in Python source code: examples_python.zip <//builddir/build/BUILD/mplcursors-0.2/doc/source/examples/examples_python.zip>`



  .. container:: sphx-glr-download

    :download:`Download all examples in Jupyter notebooks: examples_jupyter.zip <//builddir/build/BUILD/mplcursors-0.2/doc/source/examples/examples_jupyter.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
