.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/keyboard_shortcuts.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_keyboard_shortcuts.py: Keyboard shortcuts ================== By default, mplcursors uses "t" to toggle interactivity and "d" to hide/show annotation boxes. These shortcuts can be customized. .. GENERATED FROM PYTHON SOURCE LINES 8-20 .. image-sg:: /examples/images/sphx_glr_keyboard_shortcuts_001.png :alt: Press "e" to enable/disable the datacursor Press "h" to hide/show any annotation boxes :srcset: /examples/images/sphx_glr_keyboard_shortcuts_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import mplcursors fig, ax = plt.subplots() ax.plot(range(10), "o-") ax.set_title('Press "e" to enable/disable the datacursor\n' 'Press "h" to hide/show any annotation boxes') mplcursors.cursor(bindings={"toggle_visible": "h", "toggle_enabled": "e"}) plt.show() .. _sphx_glr_download_examples_keyboard_shortcuts.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: keyboard_shortcuts.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: keyboard_shortcuts.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_