user
What are the other color map for cmap='viridis'?
alphonsio

In Matplotlib (Python’s main plotting library), cmap='viridis' refers to one of many colormaps available for visualizing data.

There are several other built-in colormaps grouped by category. Here’s a full list by type:


Perceptually Uniform Sequential (good default choices like viridis)

These are designed to be perceptually uniform — meaning differences in color correspond to equal differences in data value:

  • 'viridis' 🟢🟡🟣 (default modern choice)
  • 'plasma' 🔵🟣🟠
  • 'inferno' 🟣🔴🟡
  • 'magma' 🟣🟤🟡
  • 'cividis' 🔵🟢🟡 (colorblind-friendly)

Sequential

Used for data that progresses from low to high (e.g., temperature, intensity):

  • 'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds'
  • 'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu'
  • 'BuPu', 'GnBu', 'PuBu', 'PuBuGn', 'BuGn'
  • 'YlGnBu', 'YlGn'

Diverging

Used when data diverges around a central point (e.g., positive vs negative changes):

  • 'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu'
  • 'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic'

Cyclic

For data that wraps around (e.g., angles, time of day):

  • 'twilight', 'twilight_shifted', 'hsv'

Qualitative / Categorical

For discrete categories rather than numeric data:

  • 'Pastel1', 'Pastel2', 'Paired', 'Accent', 'Dark2'
  • 'Set1', 'Set2', 'Set3', 'tab10', 'tab20', 'tab20b', 'tab20c'

Miscellaneous / Legacy

  • 'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern'
  • 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', 'rainbow'
  • 'jet' (old default, not recommended — not perceptually uniform)

Example Usage

import matplotlib.pyplot as plt
plt.imshow(data, cmap='plasma')
plt.colorbar()
plt.show()