.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "intro/matplotlib/auto_examples/plot_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_intro_matplotlib_auto_examples_plot_scatter.py: Plotting a scatter of points ============================== A simple example showing how to plot a scatter of points with matplotlib. .. GENERATED FROM PYTHON SOURCE LINES 7-26 .. image-sg:: /intro/matplotlib/auto_examples/images/sphx_glr_plot_scatter_001.png :alt: plot scatter :srcset: /intro/matplotlib/auto_examples/images/sphx_glr_plot_scatter_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt n = 1024 rng = np.random.default_rng() X = rng.normal(0, 1, n) Y = rng.normal(0, 1, n) T = np.arctan2(Y, X) plt.axes((0.025, 0.025, 0.95, 0.95)) plt.scatter(X, Y, s=75, c=T, alpha=0.5) plt.xlim(-1.5, 1.5) plt.xticks([]) plt.ylim(-1.5, 1.5) plt.yticks([]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.050 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_plot_scatter.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_scatter.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_scatter.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_scatter.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_