Color Maps & Palettes
Depending on your axis type you need one of two basic tools:
- Continuous or practically continuous (e.g. whole numbers with high variance)
- A colormap, i.e. a function mapping values to colors.
In R
Use scales or use
ggplot in the first place.
In matplotlib
plt.rcParams['image.cmap'] = ...
, plot(..., cmap=...)
- Few discrete values (e.g. qualitative)
- A palette, i.e. a fixed-size set of colors.
In R
palette()
to get and palette(colors)
to set.
In matplotlib
plt.rcParams['axes.color_cycle'] = ...
, ax.set_color_cycle(...)
This means that you want:
- Never
- jet, hot, … (no perceptive continuity/uniformity, ugly, false (artifact) features, unsuited for color blindness, no guaranteed contrast)
- For continuums: Perceptually uniform colormaps
-
- For discrete values: Fixed-size palettes with high contrast
-