.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/widgets/multicursor.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_widgets_multicursor.py: =========== Multicursor =========== Showing a cursor on multiple plots simultaneously. This example generates three axes split over two different figures. On hovering the cursor over data in one subplot, the values of that datapoint are shown in all axes. .. GENERATED FROM PYTHON SOURCE LINES 12-31 .. code-block:: default import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import MultiCursor t = np.arange(0.0, 2.0, 0.01) s1 = np.sin(2*np.pi*t) s2 = np.sin(3*np.pi*t) s3 = np.sin(4*np.pi*t) fig, (ax1, ax2) = plt.subplots(2, sharex=True) ax1.plot(t, s1) ax2.plot(t, s2) fig, ax3 = plt.subplots() ax3.plot(t, s3) multi = MultiCursor(None, (ax1, ax2, ax3), color='r', lw=1) plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /gallery/widgets/images/sphx_glr_multicursor_001.png :alt: multicursor :srcset: /gallery/widgets/images/sphx_glr_multicursor_001.png, /gallery/widgets/images/sphx_glr_multicursor_001_2_0x.png 2.0x :class: sphx-glr-multi-img * .. image-sg:: /gallery/widgets/images/sphx_glr_multicursor_002.png :alt: multicursor :srcset: /gallery/widgets/images/sphx_glr_multicursor_002.png, /gallery/widgets/images/sphx_glr_multicursor_002_2_0x.png 2.0x :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 32-38 .. admonition:: References The use of the following functions, methods, classes and modules is shown in this example: - `matplotlib.widgets.MultiCursor` .. _sphx_glr_download_gallery_widgets_multicursor.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: multicursor.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: multicursor.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_