

.. _sphx_glr_gallery_shapes_and_collections_marker_path.py:


===========
Marker Path
===========





.. image:: /gallery/shapes_and_collections/images/sphx_glr_marker_path_001.png
    :align: center





.. code-block:: python

    import matplotlib.pyplot as plt
    import matplotlib.path as mpath
    import numpy as np


    star = mpath.Path.unit_regular_star(6)
    circle = mpath.Path.unit_circle()
    # concatenate the circle with an internal cutout of the star
    verts = np.concatenate([circle.vertices, star.vertices[::-1, ...]])
    codes = np.concatenate([circle.codes, star.codes])
    cut_star = mpath.Path(verts, codes)


    plt.plot(np.arange(10)**2, '--r', marker=cut_star, markersize=15)

    plt.show()

**Total running time of the script:** ( 0 minutes  0.054 seconds)



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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


.. only:: html

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

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