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

    Click :ref:`here <sphx_glr_download_gallery_lines_bars_and_markers_scatter_custom_symbol.py>` to download the full example code
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_lines_bars_and_markers_scatter_custom_symbol.py:


=====================
Scatter Custom Symbol
=====================

Creating a custom ellipse symbol in scatter plot.





.. image:: /gallery/lines_bars_and_markers/images/sphx_glr_scatter_custom_symbol_001.png
    :class: sphx-glr-single-img





.. code-block:: python

    import matplotlib.pyplot as plt
    import numpy as np

    # unit area ellipse
    rx, ry = 3., 1.
    area = rx * ry * np.pi
    theta = np.arange(0, 2 * np.pi + 0.01, 0.1)
    verts = np.column_stack([rx / area * np.cos(theta), ry / area * np.sin(theta)])

    x, y, s, c = np.random.rand(4, 30)
    s *= 10**2.

    fig, ax = plt.subplots()
    ax.scatter(x, y, s, c, marker=verts)

    plt.show()


.. _sphx_glr_download_gallery_lines_bars_and_markers_scatter_custom_symbol.py:


.. only :: html

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



  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: scatter_custom_symbol.ipynb <scatter_custom_symbol.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>`_
