

.. _sphx_glr_gallery_lines_bars_and_markers_marker_fillstyle_reference.py:


=====================
Marker filling-styles
=====================

Reference for marker fill-styles included with Matplotlib.




.. image:: /gallery/lines_bars_and_markers/images/sphx_glr_marker_fillstyle_reference_001.png
    :align: center





.. code-block:: python

    import numpy as np
    import matplotlib.pyplot as plt
    from matplotlib.lines import Line2D


    points = np.ones(5)  # Draw 3 points for each line
    text_style = dict(horizontalalignment='right', verticalalignment='center',
                      fontsize=12, fontdict={'family': 'monospace'})
    marker_style = dict(color='cornflowerblue', linestyle=':', marker='o',
                        markersize=15, markerfacecoloralt='gray')


    def format_axes(ax):
        ax.margins(0.2)
        ax.set_axis_off()


    def nice_repr(text):
        return repr(text).lstrip('u')


    fig, ax = plt.subplots()

    # Plot all fill styles.
    for y, fill_style in enumerate(Line2D.fillStyles):
        ax.text(-0.5, y, nice_repr(fill_style), **text_style)
        ax.plot(y * points, fillstyle=fill_style, **marker_style)
        format_axes(ax)
        ax.set_title('fill style')

    plt.show()

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



.. only :: html

 .. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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


.. only:: html

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

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