

.. _sphx_glr_gallery_color:

.. _color_examples:

Color
=====

For a description of the colormaps available in Matplotlib,
see the :ref:`colormaps tutorial <tutorials-colors>`.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib recognizes the following formats to specify a color:">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Color Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use masked arrays to plot a line with different colors by y-value.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_by_yvalue_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_by_yvalue.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Color by y-value</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Display the colors from the default prop_cycle, which is obtained from the rc parameters&lt;customizing&gt;.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_cycle_default_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_cycle_default.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colors in the default property cycle</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib&#x27;s ColorSequenceRegistry allows access to predefined lists of colors by name e.g. colors = matplotlib.color_sequences[&#x27;Set1&#x27;].  This example shows all of the built in color sequences.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_sequences_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_sequences.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Named color sequences</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use colorbar by specifying the mappable object (here the AxesImage returned by imshow) and the Axes to attach the colorbar to.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_colorbar_basics_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_colorbar_basics.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colorbar</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Reference for colormaps included with Matplotlib.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_colormap_reference_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_colormap_reference.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colormap reference</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="For more detail on creating and manipulating colormaps see colormap-manipulation.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_custom_cmap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_custom_cmap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Create a colormap from a list of colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes we want to use more colors or a different set of colors than the default color cycle provides. Selecting individual colors from one of the provided colormaps can be a convenient way to do this.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_individual_colors_from_cmap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_individual_colors_from_cmap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Selecting individual colors from a colormap</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This plots a list of the named colors supported by Matplotlib. For more information on colors in matplotlib see">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_named_colors_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_named_colors.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">List of named colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compare setting alpha by the alpha keyword argument and by one of the Matplotlib color formats. Often, the alpha keyword is the only tool needed to add transparency to a color. In some cases, the (matplotlib_color, alpha) color format provides an easy way to fine-tune the appearance of a Figure.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_set_alpha_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_set_alpha.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ways to set a color's alpha value</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/color/color_demo
   /gallery/color/color_by_yvalue
   /gallery/color/color_cycle_default
   /gallery/color/color_sequences
   /gallery/color/colorbar_basics
   /gallery/color/colormap_reference
   /gallery/color/custom_cmap
   /gallery/color/individual_colors_from_cmap
   /gallery/color/named_colors
   /gallery/color/set_alpha

