.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/scatter.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_scatter.py: Scatter plots are highlighted point-by-point. ============================================= ... as opposed to lines with a ``"."`` style, which have the same appearance, but are highlighted as a whole. .. GENERATED FROM PYTHON SOURCE LINES 8-22 .. image-sg:: /examples/images/sphx_glr_scatter_001.png :alt: Highlighting affects individual points only in scatter plots (top two axes) :srcset: /examples/images/sphx_glr_scatter_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt import mplcursors x, y, z = np.random.random((3, 10)) fig, axs = plt.subplots(3) fig.suptitle("Highlighting affects individual points\n" "only in scatter plots (top two axes)") axs[0].scatter(x, y, c=z, s=100 * np.random.random(10)) axs[1].scatter(x, y) axs[2].plot(x, y, "o") mplcursors.cursor(highlight=True) plt.show() .. _sphx_glr_download_examples_scatter.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: scatter.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: scatter.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_