.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/hover.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_hover.py: Annotate on hover ================= When *hover* is set to ``True``, annotations are displayed when the mouse hovers over the artist, without the need for clicking. .. GENERATED FROM PYTHON SOURCE LINES 8-21 .. image-sg:: /examples/images/sphx_glr_hover_001.png :alt: Mouse over a point :srcset: /examples/images/sphx_glr_hover_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import mplcursors np.random.seed(42) fig, ax = plt.subplots() ax.scatter(*np.random.random((2, 26))) ax.set_title("Mouse over a point") mplcursors.cursor(hover=True) plt.show() .. _sphx_glr_download_examples_hover.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: hover.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: hover.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_