.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\python_packages\matplotlib\demo_multicursor.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_python_packages_matplotlib_demo_multicursor.py: Multi cursor =============== .. GENERATED FROM PYTHON SOURCE LINES 5-20 .. image-sg:: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_multicursor_001.png :alt: demo multicursor :srcset: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_multicursor_001.png :class: sphx-glr-single-img .. 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(4 * np.pi * t) fig, (ax1, ax2) = plt.subplots(2, sharex=True) ax1.plot(t, s1) ax2.plot(t, s2) multi = MultiCursor(fig.canvas, (ax1, ax2), color="r", lw=1) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.141 seconds) .. _sphx_glr_download_11_demos_python_packages_matplotlib_demo_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: demo_multicursor.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_multicursor.ipynb `