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

.. only:: html

    .. meta::
        :keywords: codex

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

        :ref:`Go to the end <sphx_glr_download_gallery_lines_bars_and_markers_scatter_star_poly.py>`
        to download the full example code.

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

.. _sphx_glr_gallery_lines_bars_and_markers_scatter_star_poly.py:


===============
Marker examples
===============

Example with different ways to specify markers.

See also the `matplotlib.markers` documentation for a list of all markers and
:doc:`/gallery/lines_bars_and_markers/marker_reference` for more information
on configuring markers.

.. redirect-from:: /gallery/lines_bars_and_markers/scatter_custom_symbol
.. redirect-from:: /gallery/lines_bars_and_markers/scatter_symbol
.. redirect-from:: /gallery/lines_bars_and_markers/scatter_piecharts

.. GENERATED FROM PYTHON SOURCE LINES 16-55

.. code-block:: Python

    import matplotlib.pyplot as plt
    import numpy as np

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

    x = np.random.rand(10)
    y = np.random.rand(10)
    z = np.sqrt(x**2 + y**2)

    fig, axs = plt.subplots(2, 3, sharex=True, sharey=True, layout="constrained")

    # Matplotlib marker symbol
    axs[0, 0].scatter(x, y, s=80, c=z, marker=">")
    axs[0, 0].set_title("marker='>'")

    # marker from TeX: passing a TeX symbol name enclosed in $-signs
    axs[0, 1].scatter(x, y, s=80, c=z, marker=r"$\clubsuit$")
    axs[0, 1].set_title(r"marker=r'\$\clubsuit\$'")

    # marker from path: passing a custom path of N vertices as a (N, 2) array-like
    verts = [[-1, -1], [1, -1], [1, 1], [-1, -1]]
    axs[0, 2].scatter(x, y, s=80, c=z, marker=verts)
    axs[0, 2].set_title("marker=verts")

    # regular pentagon marker
    axs[1, 0].scatter(x, y, s=80, c=z, marker=(5, 0))
    axs[1, 0].set_title("marker=(5, 0)")

    # regular 5-pointed star marker
    axs[1, 1].scatter(x, y, s=80, c=z, marker=(5, 1))
    axs[1, 1].set_title("marker=(5, 1)")

    # regular 5-pointed asterisk marker
    axs[1, 2].scatter(x, y, s=80, c=z, marker=(5, 2))
    axs[1, 2].set_title("marker=(5, 2)")

    plt.show()




.. image-sg:: /gallery/lines_bars_and_markers/images/sphx_glr_scatter_star_poly_001.png
   :alt: marker='>', marker=r'\$\clubsuit\$', marker=verts, marker=(5, 0), marker=(5, 1), marker=(5, 2)
   :srcset: /gallery/lines_bars_and_markers/images/sphx_glr_scatter_star_poly_001.png, /gallery/lines_bars_and_markers/images/sphx_glr_scatter_star_poly_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 56-60

.. tags::

   component: marker
   level: beginner


.. _sphx_glr_download_gallery_lines_bars_and_markers_scatter_star_poly.py:

.. only:: html

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

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

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

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

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

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: scatter_star_poly.zip <scatter_star_poly.zip>`


.. only:: html

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

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
