Matplotlib Color and Colormap Picker

This page lists every named color and every built-in colormap in Matplotlib 3.11, so you can find one by looking instead of scrolling a reference table. Click a color or colormap to see the code for it, and click Copy to put it on your clipboard. Everything runs in your browser.

Matplotlib Named Colors

Pass any of these names as color="steelblue" (or c=, facecolor=, edgecolor=). The default sort groups colors by hue. The Tableau group is the default color cycle ("tab:blue", "tab:orange", and so on, also written "C0" to "C9").

Matplotlib Colormaps

Pass a colormap as cmap="viridis" to scatter, imshow, pcolormesh, contourf and similar. Add _r to reverse it. Use the vision menu to check whether a colormap still works in grayscale (a printout) or for common kinds of color blindness. The simulation is an approximation, good enough to spot a problem.

How to Pick a Matplotlib Colormap

Your data Use Examples
Low to high, one direction Perceptually uniform sequential viridis, plasma, cividis
Counts or density, to be printed A sequential map that survives grayscale viridis, Blues, gray
Above and below a midpoint Diverging, with a meaningful center RdBu, coolwarm, PuOr
Angles, hours, wind direction Cyclic, so the ends match twilight, hsv
Categories Qualitative tab10, Set2, okabe_ito

jet, rainbow and gist_rainbow look vivid but are uneven in lightness: switch the preview to grayscale and they turn into bands. cividis was designed to look the same with or without red-green color blindness, and okabe_ito (added in Matplotlib 3.11) is a qualitative set built for the same reason. The colormap reference shows each one applied to real charts.

The same lookups in Python

import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
import numpy as np

print(mcolors.to_hex("steelblue"))  # '#4682b4'
print(mcolors.to_rgb("steelblue"))  # (0.2745098039215686, 0.5098039215686275, 0.7058823529411765)

cmap = plt.get_cmap("viridis")
print([mcolors.to_hex(c) for c in cmap(np.linspace(0, 1, 5))])
# ['#440154', '#3b528b', '#21918c', '#5ec962', '#fde725']

print(len(mcolors.CSS4_COLORS), "CSS colors,", len(plt.colormaps()), "registered colormaps")

plt.colormaps() lists 182 names because it includes every _r reversed copy and a few aliases (grey for gray). This page leaves out the 949 xkcd: survey colors, which you can still use as "xkcd:sky blue"; see hex colors in Matplotlib for how color strings are parsed, and custom colormaps for building your own.

Last updated: Dec 06, 2026