
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/shapes_and_collections/scatter.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_gallery_shapes_and_collections_scatter.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_shapes_and_collections_scatter.py:


============
Scatter plot
============

This example showcases a simple scatter plot.

.. GENERATED FROM PYTHON SOURCE LINES 8-24

.. code-block:: default

    import numpy as np
    import matplotlib.pyplot as plt

    # Fixing random state for reproducibility
    np.random.seed(19680801)


    N = 50
    x = np.random.rand(N)
    y = np.random.rand(N)
    colors = np.random.rand(N)
    area = (30 * np.random.rand(N))**2  # 0 to 15 point radii

    plt.scatter(x, y, s=area, c=colors, alpha=0.5)
    plt.show()




.. image:: /gallery/shapes_and_collections/images/sphx_glr_scatter_001.png
    :alt: scatter
    :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 25-31

------------

References
""""""""""

The use of the following functions and methods is shown in this example:

.. GENERATED FROM PYTHON SOURCE LINES 32-36

.. code-block:: default

    import matplotlib

    matplotlib.axes.Axes.scatter
    matplotlib.pyplot.scatter




.. rst-class:: sphx-glr-script-out

 Out:

 .. code-block:: none


    <function scatter at 0x7f73be8291f0>




.. _sphx_glr_download_gallery_shapes_and_collections_scatter.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download sphx-glr-download-python

     :download:`Download Python source code: scatter.py <scatter.py>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

     :download:`Download Jupyter notebook: scatter.ipynb <scatter.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    Keywords: matplotlib code example, codex, python plot, pyplot
    `Gallery generated by Sphinx-Gallery
    <https://sphinx-gallery.readthedocs.io>`_
