🌐
CRAN
cran.r-project.org › web › packages › viridis › vignettes › intro-to-viridis.html
Introduction to the viridis color maps
It is immediately clear that the “rainbow” palette is not perceptually uniform; there are several “kinks” where the apparent color changes quickly over a short range of values. This is also true, though less so, for the “heat” colors. The other scales are more perceptually uniform, but “viridis” stands out for its large perceptual range.
🌐
Waldyrious
waldyrious.net › viridis-palette-generator
Viridis Color Palette Generator
Popular for good reason, the palettes are colorblind-friendly, retain representational clarity in greyscale, and are generally aesthetically pleasing. This tool provides a convenience wrapper around D3js's viridis implementation for use in data visualization tools with manual color value specification (e.g., Microsoft Excel, ArcGIS, and Tableau to name a few).
🌐
Sjmgarnier
sjmgarnier.github.io › viridisLite › reference › viridis.html
Viridis Color Palettes — viridis • viridisLite
viridis returns a character vector, cv, of color hex codes. This can be used either to create a user-defined color palette for subsequent graphics by palette(cv), a col = specification in graphics functions or in par.
🌐
Gabors Data Analysis
gabors-data-analysis.com › posts › 2020 › 10 › viridis
On picking the Viridis color scheme - Gabors Data Analysis
October 18, 2020 - The viridis color palette in R by Bob Rudis, Noam Ross and Simon Garnier Matplotlib colormaps, Option “D”.
🌐
Nature
nature.com › nature methods › this month › article
Color scales and the birth of viridis | Nature Methods
June 11, 2026 - Nature Methods - The color palette viridis is replacing rainbow color schemes in scientific figures, for good reason.
🌐
R Graph Gallery
r-graph-gallery.com › package › viridis.html
Create beautiful color maps with Viridis
The viridis package can be used with the lattice package to create beautiful plots. You can use the colorkey argument to specify a color palette from the viridis package.
🌐
Adnia
adniaconseils.ca › home › the viridis color palette: a good choice in data visualization
The Viridis Color Palette: A Good Choice in Data Visualization
February 6, 2026 - Unlike many traditional palettes, Viridis remains uniform in a perceptible way and is easily distinguished by people with visual impairments. Viridis maintains perceptual uniformity, meaning that color variations are consistent and not misleading, ensuring proper data interpretation.
🌐
RPubs
rpubs.com › mjvoss › psc_viridis
RPubs - Viridis Color Palette
August 10, 2021 - Viridis Color Palette · by Matthew Voss · Last updated about 5 years ago · Hide Comments (–) Share Hide Toolbars ·
🌐
Loading.io
loading.io › color › feature › Viridis
Viridis » Beautiful Color Palettes for Your Next Design · Loading.io
loading.io's Viridis palette contains 4 colors including #482173,#2e6f8e,#29af7f,#bddf26, available in PNG / SVG / JSON and SCSS format for your next design project.
Find elsewhere
🌐
GitHub
github.com › sjmgarnier › viridis
GitHub - sjmgarnier/viridis: Colorblind-Friendly Color Maps for R · GitHub
The color map cividis is a corrected version of 'viridis', developed by Jamie R. Nuñez, Christopher R. Anderton, and Ryan S. Renslow, and originally ported to R by Marco Sciaini (@msciain).
Top answer
1 of 6
35

There have been some good and useful suggestions already but let me add a few remarks:

  1. The viridis and magma palettes are sequential palettes with multiple hues. Thus, along the scale you increase from very light colors to rather dark colors. Simultaneously the colorfulness is increased and the hue changes from yellow to blue (either via green or via red).
  2. Diverging palettes can be created by combining two sequential palettes. Typically, you join them at the light colors and then let them diverge to different dark colors.
  3. Usually, one uses single-hue sequential palettes that diverge from a neutral light gray to two different dark colors. One should pay attention though that the different "arms" of the palette are balanced with respect to luminance (light-dark) and chroma (colorfuness).

Therefore, combining magma and viridis does not work well. You could let them diverge from a similar yellowish color but you would diverge to similar blueish colors. Also with the changing hues it would just become more difficult to judge in which arm of the palette you are.

As mentioned by others, ColorBrewer.org provides good diverging palettes. Moreland's approach is also useful. Yet another general solution is our diverging_hcl() function in the colorspace package. In the accompanying paper at https://arxiv.org/abs/1903.06490 (forthcoming in JSS) the construction principles are described and also how the general HCL-based strategy can approximate numerous palettes from ColorBrewer.org, CARTO, etc. (Earlier references include our initial work in CSDA at http://dx.doi.org/10.1016/j.csda.2008.11.033 and further recommendations geared towards meteorology, but applicable beyond, in a BAMS paper at http://dx.doi.org/10.1175/BAMS-D-13-00155.1.)

The advantage of our solution in HCL space (hue-chroma-luminance) is that you can interpret the coordinates relatively easily. It does take some practice but isn't as opaque as other solutions. Also we provide a GUI hclwizard() (see below) that helps understanding the importance of the different coordinates.

Most of the palettes in the question and the other answers can be matched rather closely by diverging_hcl() provided that the two hues (argument h), the maximum chroma (c), and minimal/maximal luminance (l) are chosen appropriately. Furthermore, one may have to tweak the power argument which controls how quickly chroma and luminance are increased, respectively. Typically, chroma is added rather quickly (power[1] < 1) whereas luminance is increased more slowly (power[2] > 1).

Moreland's "cool-warm" palette for example uses a blue (h = 250) and red (h = 10) hue but with a relatively small luminance contrast(l = 37 vs. l = 88):

coolwarm_hcl <- colorspace::diverging_hcl(11,
  h = c(250, 10), c = 100, l = c(37, 88), power = c(0.7, 1.7))

which looks rather similar (see below) to:

coolwarm <- Rgnuplot:::GpdivergingColormap(seq(0, 1, length.out = 11),
  rgb1 = colorspace::sRGB( 0.230, 0.299, 0.754),
  rgb2 = colorspace::sRGB( 0.706, 0.016, 0.150),
  outColorspace = "sRGB")
coolwarm[coolwarm > 1] <- 1
coolwarm <- rgb(coolwarm[, 1], coolwarm[, 2], coolwarm[, 3])

In contrast, ColorBrewer.org's BrBG palette a much higher luminance contrast (l = 20 vs. l = 95):

brbg <- rev(RColorBrewer::brewer.pal(11, "BrBG"))
brbg_hcl <- colorspace::diverging_hcl(11,
  h = c(180, 50), c = 80, l = c(20, 95), power = c(0.7, 1.3))

The resulting palettes are compared below with the HCL-based version below the original. You see that these are not identical but rather close. On the right-hand side I've also matched viridis and plasma with HCL-based palettes.

Whether you prefer the cool-warm or BrBG palette may depend on your personal taste but also - more importantly - what you want to bring out in your visualization. The low luminance contrast in cool-warm will be more useful if the sign of the deviation matters most. A high luminance contrast will be more useful if you want to bring out the size of the (extreme) deviations. More practical guidance is provided in the papers above.

The rest of the replication code for the figure above is:

viridis <- viridis::viridis(11)
viridis_hcl <- colorspace::sequential_hcl(11,
  h = c(300, 75), c = c(35, 95), l = c(15, 90), power = c(0.8, 1.2))

plasma <- viridis::plasma(11)
plasma_hcl <- colorspace::sequential_hcl(11,
  h = c(-100, 100), c = c(60, 100), l = c(15, 95), power = c(2, 0.9))

pal <- function(col, border = "transparent") {
  n <- length(col)
  plot(0, 0, type="n", xlim = c(0, 1), ylim = c(0, 1),
    axes = FALSE, xlab = "", ylab = "")
  rect(0:(n-1)/n, 0, 1:n/n, 1, col = col, border = border)
}

par(mar = rep(0, 4), mfrow = c(4, 2))
pal(coolwarm)
pal(viridis)
pal(coolwarm_hcl)
pal(viridis_hcl)
pal(brbg)
pal(plasma)
pal(brbg_hcl)
pal(plasma_hcl)

Update: These HCL-based approximations of colors from other tools (ColorBrewer.org, viridis, scico, CARTO, ...) are now also available as named palettes in both the colorspace package and the hcl.colors() function from the basic grDevices package (starting from 3.6.0). Thus, you can now also say easily:

colorspace::sequential_hcl(11, "viridis")
grDevices::hcl.colors(11, "viridis")

Finally, you can explore our proposed colors interactively in a shiny app: http://hclwizard.org:64230/hclwizard/. For users of R, you can also start the shiny app locally on your computer (which runs somewhat faster than from our server) or you can run a Tcl/Tk version of it (which is even faster):

colorspace::hclwizard(gui = "shiny")
colorspace::hclwizard(gui = "tcltk")

If you want to understand what the paths of the palettes look like in RGB and HCL coordinates, the colorspace::specplot() is useful. See for example colorspace::specplot(coolwarm).

2 of 6
25

The scico package (Palettes for R based on the Scientific Colour-Maps ) has several good diverging palettes that are perceptually uniform and colorblind safe (e.g., vik, roma, berlin).

Also available for Python, MatLab, GMT, QGIS, Plotly, Paraview, VisIt, Mathematica, Surfer, d3, etc. here

Paper: Crameri, F. (2018), Geodynamic diagnostics, scientific visualisation and StagLab 3.0, Geosci. Model Dev., 11, 2541-2562, doi:10.5194/gmd-11-2541-2018

Blog: The Rainbow Colour Map (repeatedly) considered harmful

# install.packages('scico')
# or
# install.packages("devtools")
# devtools::install_github("thomasp85/scico")
library(scico)
scico_palette_show(palettes = c("broc", "cork", "vik",
                                "lisbon", "tofino", "berlin",
                                "batlow", "roma"))

Another great package is cmocean. Its colormaps are available in R via the pals package or the oce package.

Paper: Thyng, K. M., Greene, C. A., Hetland, R. D., Zimmerle, H. M., & DiMarco, S. F. (2016). True colors of oceanography. Oceanography, 29(3), 10, http://dx.doi.org/10.5670/oceanog.2016.66.

Talk: PLOTCON 2016: Kristen Thyng, Custom Colormaps for Your Field.

### install.packages("devtools")    
### devtools::install_github("kwstat/pals")   
library(pals)   
pal.bands(ocean.balance, ocean.delta, ocean.curl, main = "cmocean")   


Edit: add seven levels max colorblind-friendly palettes from the rcartocolor package

library(rcartocolor)
display_carto_all(type = 'diverging', colorblind_friendly = TRUE)

🌐
Tidyverse
ggplot2.tidyverse.org › reference › scale_viridis.html
Viridis colour scales from viridisLite — scale_colour_viridis_d • ggplot2
# viridis is the default colour/fill scale for ordered factors set.seed(596) dsamp <- diamonds[sample(nrow(diamonds), 1000), ] ggplot(dsamp, aes(carat, price)) + geom_point(aes(colour = clarity)) # Use viridis_d with discrete data txsamp <- subset(txhousing, city %in% c("Houston", "Fort Worth", "San Antonio", "Dallas", "Austin")) (d <- ggplot(data = txsamp, aes(x = sales, y = median)) + geom_point(aes(colour = city))) d + scale_colour_viridis_d() # Change scale label d + scale_colour_viridis_d("City\nCenter") # Select palette to use, see ?scales::pal_viridis for more details d + scale_colour_v
🌐
Pinterest
pinterest.com › explore › design › viridis color palette
Viridis Color Palette
Discover Pinterest’s best ideas and inspiration for Viridis color palette.
🌐
DevGenius
blog.devgenius.io › the-art-of-color-schemes-in-r-base-and-viridis-palettes-141f2b613541
The Art of Color Schemes in R: base and viridis palettes | by Dima from Mithridata | Dev Genius
June 6, 2023 - They are simple yet effective for differentiating data points. Viridis color scales (viridis package): Known for its large perceptual range, the Viridis color scale is designed to be uniform and colorblind-friendly.
🌐
Jose M Sallan blog
jmsallan.netlify.app › blog › the-viridis-palettes
The viridis palettes - Jose M Sallan blog
viridis is now the default color scheme for Python mathlotlib.We can access the viridis scales through the viridis package, which also loads viridisLite. Unlike the brewer palettes, the viridis color scales can have any number of colors, so ...
🌐
Data Savvy
datasavvy.me › home › accessibility › viridis color palettes in power bi theme files
Viridis color palettes in Power BI theme files - Data Savvy
April 25, 2022 - This diverging palette includes the darkest and lightest color in an effort to give you a wider scale.
🌐
Andrewheiss
datavizf24.classes.andrewheiss.com › resource › colors.html
Color palettes – Data Visualization with R
The viridis palettes come with {ggplot2} and you can use them with scale_fill_viridis_d()/scale_color_viridis_d() for discrete data and scale_fill_viridis_c()/scale_color_viridis_c() for continuous data.
🌐
Matplotlib
matplotlib.org › stable › users › explain › colors › colormaps.html
Choosing Colormaps in Matplotlib — Matplotlib 3.11.2 documentation
plot_color_gradients('Perceptually Uniform Sequential', ['viridis', 'plasma', 'inferno', 'magma', 'cividis'])
🌐
Databrewer
databrewer.co › R › visualization › 16-ggplot2-color-viridis-palette
A Complete Guide on the Viridis Color Palettes
Unlike the brewer palettes which are subjected to the maximum color number limits, the viridis palette has no such limit; it allows an unlimited number of transitional colors to be automatically interpolated and extracted.