pals (version 1.7)

continuous: Miscellaneous colormaps


Colormaps designed for continuous data.


cubehelix(n = 25, start = 0.5, r = -1.5, hue = 1, gamma = 1)

gnuplot(n = 25, trim = 0.1)

tol.rainbow(n = 25, manual = TRUE)

jet(n = 25)

parula(n = 25)

turbo(n = 25)

coolwarm(n = 25)

warmcool(n = 25)

cividis(n = 25)



Number of colors to return.


Start angle (radians) of the helix


Number of rotations of the helix


Saturation of the colors, 0 = grayscale, 1 = fully saturated


gamma < 1 emphasizes low intensity values, gamma > 1 emphasizes high intensity values


Proportion of tail colors to trim, default 0.1


If TRUE, return manually-calibrated colors.


A vector of colors.


The coolwarm and 'warmcool' palette by Moreland (2009) is colorblind safe. The transition to and from gray is smooth, to reduce Mach banding.

The cubehelix palette is sometimes used in astronomy. Images using this palette will look monotonically increasing to both the human eye and when printed in black and white. This palette is named 'cubehelix' because the r,g,b values produced can be visualised as a squashed helix around the diagonal from black (0,0,0) to white (1,1,1) in the r,g,b color cube.

The gnuplot palette uses black-blue-pink-yellow colors. This palette looks good when printed in black and white. Identical to the sp::bpy.colors palette.

The jet palette should not be used and is only provided for historical interest. The code for this palette comes from the example section of colorRampPalette. The 'jet' palette gained popularity as the default colormap in older versions of Matlab. Because of the unevenness of the gradient, jet will exaggerate some features of the data and minimize other features.

The parula palette here is similar to the default Matlab palette. Specific colors were adapted from the BIDS/colormap package.

The tol.rainbow palette by Tol (2012) is a dark rainbow palette from purple to red which works much better than standard rainbow palettes for colorblind people. If 1 <= n <= 13, manually-chosen equidistant rainbow colors are used, where distances are defined by the CIEDE2000 color difference. If 14 <= n <= 21, manually-chosen triplets of colours are used. If n > 21 or if manual=FALSE, the palette computes the colors according to Equation 3 of Tol (2012).

The cividis palette by Jamie R. Nu<U+00F1>ez, Christopher R. Anderton, Ryan S. Renslow, is a variation of viridis that is less colorful.

The turbo palette by Mikhailov, is similar to jet, but avoids the artificial color banding that plagues jet. See also tol.rainbow.


Dave A. Green. (2011). A colour scheme for the display of astronomical intensity images. Bull. Astr. Soc. India, 39, 289-295.

Kenneth Moreland. (2009). Diverging Color Maps for Scientific Visualization. Proceedings of the 5th International Symposium on Visual Computing.

Paul Tol (2012). Color Schemes. SRON technical note, SRON/EPS/TN/09-002.

My Favorite Colormap. (gnuplot)

MathWorks documentation.


Jamie R. Nu<U+00F1>ez, Christopher R. Anderton, Ryan S. Renslow (2017). An optimized colormap for the scientific community.

Anton Mikhailov, Turbo, An Improved Rainbow Colormap for Visualization (2019).


Run this code
pal.bands(coolwarm, cubehelix, gnuplot, parula, cividis, jet, turbo, tol.rainbow)


# ----- coolwarm -----
pal.test(coolwarm) # Minimal mach banding
# Note the mach banding gray line in the following:
# pal.volcano(colorRampPalette(c("#3B4CC0", "lightgray", "#B40426")))

# ----- cubehelix -----
# Full range of colors. Pink is overwhelming. Not the best choice.

# Mostly blues/greens. Dark areas severely too black. 
# Similar, but more saturated. See:
pal.volcano(function(n) cubehelix(n, start=.25, r=-.67, hue=1.5))

# Dark colors totally lose structure of the volcano peak.
op <- par(mfrow=c(2,2), mar=c(2,2,2,2))
image(volcano, col = cubehelix(51), asp = 1, axes=0, main="cubehelix")
image(volcano, col = cubehelix(51, start=.25, r=-.67, hue=1.5), asp = 1, axes=0, main="cubehelix")
image(volcano, col = rev(cubehelix(51)), asp = 1, axes=0, main="cubehelix")
image(volcano, col = rev(cubehelix(51, start=.25, r=-.67, hue=1.5)), 
                                   asp = 1, axes=0, main="cubehelix")

# ----- gnuplot -----

# ----- jet -----
# pal.volcano(jet)

# ----- parula -----
# pal.volcano(parula)

# ----- tol.rainbow -----
# pal.volcano(tol.rainbow)


# ----- cividis -----
# pal.volcano(cividis)

# }

Run the code above in your browser using DataCamp Workspace