Open links in new tab
  1. List of named colors — Matplotlib 3.10.8 documentation

    python - Named colors in matplotlib - Stack Overflow

    What named colors are available in matplotlib for use in plots? I can find a li…

    Stack Overflow

    Initial release

    Stable release

    Written in

    Specifying colors — Matplotlib 3.10.8 documentation

    Specifying colors # Color formats # Matplotlib recognizes the following formats to specify a color.

    Matplotlib
    Choosing Colormaps in Matplotlib — Matplotlib 3.10.8 documentation

    Choosing Colormaps in Matplotlib # Matplotlib has a number of built-in colormaps accessible via matplotlib.colormaps. There are also external libraries that have many extra color…

    Matplotlib
  1. In Python, libraries like Matplotlib and Plotly support CSS named colors, allowing you to style plots using human-readable color names instead of hex codes. These names follow the standard HTML/CSS color specification, making them easy to remember and use.

    Example: Using CSS Colors in Matplotlib

    import matplotlib.pyplot as plt

    colors = ['royalblue', 'tomato', 'gold', 'seagreen']
    plt.bar(['A', 'B', 'C', 'D'], [5, 7, 3, 8], color=colors)
    plt.title("Bar Chart with CSS Colors")
    plt.show()
    Copied!

    This will render a bar chart where each bar uses a different CSS color name.

    Using CSS Colors in Plotly Plotly also supports all standard CSS color names for properties like marker_color or line_color.

    import plotly.graph_objects as go

    fig = go.Figure([
    go.Bar(
    x=['Jan', 'Feb', 'Mar'],
    y=[20, 14, 25],
    marker_color='mediumseagreen' # Named CSS color
    )
    ])
    fig.show()
    Copied!

    Here, mediumseagreen is directly recognized without needing RGB or hex values.

    Feedback
  2. python - Named colors in matplotlib - Stack Overflow

    If you would like to use additional named colors when plotting with matplotlib, you can use the xkcd crowdsourced color names, via the 'xkcd:' prefix: Now you have access to a plethora of named colors!
    See more on stackoverflow.com
    • Reviews: 3

      Code sample

      colors = dict(mcolors.BASE_COLORS, **mcolors.CSS4_COLORS)
      by_hsv = sorted((tuple(mcolors.rgb_to_hsv(mcolors.to_rgba(color)[:3])), name)
        for name, color in colors.items())
      sorted_names = [name for hsv, name in by_hsv]
      n = len(sorted_names)...
    • Supported CSS Colors in Python - Plotly

      Detailed examples of Supported CSS Colors including changing color, size, log axes, and more in Python.

    • Matplotlib Colors - A Guide to mcolors - GeeksforGeeks

      Jul 23, 2025 · This dictionary contains a large selection of color names that are valid CSS color names, mapped to their corresponding hexadecimal color codes. …

    • webcolors · PyPI

      Oct 31, 2025 · A library for working with the color formats defined by HTML and CSS.

    • Available colors in Matplotlib - The Python Graph Gallery

      This post explains how to use hexadecimal color codes, pre-defined color names, RGB tuples, and RGBA tuples in Matplotlib. The post also shows the full list of …

    • People also ask
    • Matplotlib colors [Full List, Color Converter and Color

      Use the color pickers to change the panel color (left) and the plot color (right), or to generate random colors pressing the blue button. Then you can copy the colors …

    • HTML and CSS for Python Developers

      This tutorial guides you through the basics of creating HTML files, using CSS for styling, and leveraging Python to manage HTML content programmatically. By …

    • Matplotlib | Color settings! (RGB, Hex, Grayscale, …

      Jul 1, 2024 · This article will explain in detail how to set up Matplotlib’s color-related settings. After reading it, you will be able to freely set the colors of your graphs …

    • Colors - GitHub Pages

      In this tutorial I explain some of the different ways you can use and manipulate colors in matplotlib. You may already know that you can pass a color argument …