viridis/0000755000176200001440000000000013257205350011725 5ustar liggesusersviridis/inst/0000755000176200001440000000000012664654630012714 5ustar liggesusersviridis/inst/doc/0000755000176200001440000000000012664654630013461 5ustar liggesusersviridis/inst/doc/intro-to-viridis.R0000644000176200001440000001564413257176613017037 0ustar liggesusers## ----setup, include=FALSE------------------------------------------------ library(viridis) knitr::opts_chunk$set(echo = TRUE, fig.retina=2, fig.width=7, fig.height=5) ## ----tldr_base, message=FALSE-------------------------------------------- x <- y <- seq(-8*pi, 8*pi, len = 40) r <- sqrt(outer(x^2, y^2, "+")) filled.contour(cos(r^2)*exp(-r/(2*pi)), axes=FALSE, color.palette=viridis, asp=1) ## ---- tldr_ggplot, message=FALSE----------------------------------------- library(ggplot2) ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_viridis() + theme_bw() ## ----for_repeat, include=FALSE------------------------------------------- n_col <- 128 img <- function(obj, nam) { image(1:length(obj), 1, as.matrix(1:length(obj)), col=obj, main = nam, ylab = "", xaxt = "n", yaxt = "n", bty = "n") } ## ----begin, message=FALSE, include=FALSE--------------------------------- library(viridis) library(scales) library(colorspace) library(dichromat) ## ----show_scales, echo=FALSE,fig.height=3.575---------------------------- par(mfrow=c(5, 1), mar=rep(1, 4)) img(rev(viridis(n_col)), "viridis") img(rev(magma(n_col)), "magma") img(rev(plasma(n_col)), "plasma") img(rev(inferno(n_col)), "inferno") img(rev(cividis(n_col)), "cividis") ## ----01_normal, echo=FALSE----------------------------------------------- par(mfrow=c(7, 1), mar=rep(1, 4)) img(rev(rainbow(n_col)), "rainbow") img(rev(heat.colors(n_col)), "heat") img(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "ggplot default") img(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "brewer blues") img(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "brewer yellow-green-blue") img(rev(viridis(n_col)), "viridis") img(rev(magma(n_col)), "magma") ## ----02_deutan, echo=FALSE----------------------------------------------- par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "deutan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "deutan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "deutan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "deutan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "deutan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "deutan"), "viridis") img(dichromat(rev(magma(n_col)), "deutan"), "magma") ## ----03_protan, echo=FALSE----------------------------------------------- par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "protan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "protan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "protan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "protan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "protan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "protan"), "viridis") img(dichromat(rev(magma(n_col)), "protan"), "magma") ## ----04_tritan, echo=FALSE----------------------------------------------- par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "tritan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "tritan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "tritan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "tritan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "tritan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "tritan"), "viridis") img(dichromat(rev(magma(n_col)), "tritan"), "magma") ## ----05_desatureated, echo=FALSE----------------------------------------- par(mfrow=c(7, 1), mar=rep(1, 4)) img(desaturate(rev(rainbow(n_col))), "rainbow") img(desaturate(rev(heat.colors(n_col))), "heat") img(desaturate(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col)))), "ggplot default") img(desaturate(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col))), "brewer blues") img(desaturate(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col))), "brewer yellow-green-blue") img(desaturate(rev(viridis(n_col))), "viridis") img(desaturate(rev(magma(n_col))), "magma") ## ----tempmap, message=FALSE---------------------------------------------- library(rasterVis) library(httr) par(mfrow=c(1,1), mar=rep(0.5, 4)) temp_raster <- "http://ftp.cpc.ncep.noaa.gov/GIS/GRADS_GIS/GeoTIFF/TEMP/us_tmax/us.tmax_nohads_ll_20150219_float.tif" try(GET(temp_raster, write_disk("us.tmax_nohads_ll_20150219_float.tif")), silent=TRUE) us <- raster("us.tmax_nohads_ll_20150219_float.tif") us <- projectRaster(us, crs="+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs") image(us, col=inferno(256), asp=1, axes=FALSE, xaxs="i", xaxt='n', yaxt='n', ann=FALSE) ## ---- ggplot2------------------------------------------------------------ unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", header = FALSE, stringsAsFactors = FALSE) names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", "?", "?", "?", "rate") unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) county_df <- map_data("county", projection = "albers", parameters = c(39, 45)) names(county_df) <- c("long", "lat", "group", "order", "state_name", "county") county_df$state <- state.abb[match(county_df$state_name, tolower(state.name))] county_df$state_name <- NULL state_df <- map_data("state", projection = "albers", parameters = c(39, 45)) choropleth <- merge(county_df, unemp, by = c("state", "county")) choropleth <- choropleth[order(choropleth$order), ] ggplot(choropleth, aes(long, lat, group = group)) + geom_polygon(aes(fill = rate), colour = alpha("white", 1 / 2), size = 0.2) + geom_polygon(data = state_df, colour = "white", fill = NA) + coord_fixed() + theme_minimal() + ggtitle("US unemployment rate by county") + theme(axis.line = element_blank(), axis.text = element_blank(), axis.ticks = element_blank(), axis.title = element_blank()) + scale_fill_viridis(option="magma") ## ----discrete------------------------------------------------------------ p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(size=4, aes(colour = factor(cyl))) + scale_color_viridis(discrete=TRUE) + theme_bw() viridis/inst/doc/intro-to-viridis.Rmd0000644000176200001440000002755013235067470017353 0ustar liggesusers--- title: "The viridis color palettes" author: - "Bob Rudis, Noam Ross and Simon Garnier" date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true toc_depth: 1 vignette: > %\VignetteIndexEntry{Intro to the viridis color palette} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- # tl;dr Use the color scales in this package to make plots that are pretty, better represent your data, easier to read by those with colorblindness, and print well in grey scale. Install **viridis** like any R package: ``` install.packages("viridis") library(viridis) ``` For base plots, use the `viridis()` function to generate a palette: ```{r setup, include=FALSE} library(viridis) knitr::opts_chunk$set(echo = TRUE, fig.retina=2, fig.width=7, fig.height=5) ``` ```{r tldr_base, message=FALSE} x <- y <- seq(-8*pi, 8*pi, len = 40) r <- sqrt(outer(x^2, y^2, "+")) filled.contour(cos(r^2)*exp(-r/(2*pi)), axes=FALSE, color.palette=viridis, asp=1) ``` For ggplot, use `scale_color_viridis()` and `scale_fill_viridis()`: ```{r, tldr_ggplot, message=FALSE} library(ggplot2) ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_viridis() + theme_bw() ``` # Introduction The [**viridis**](https://cran.r-project.org/package=viridis) package brings to R color scales created by [Stéfan van der Walt](https://github.com/stefanv) and [Nathaniel Smith](https://github.com/njsmith) for the Python **matplotlib** library. These color scales are designed to be: - **Colorful**, spanning as wide a palette as possible so as to make differences easy to see, - **Perceptually uniform**, meaning that values close to each other have similar-appearing colors and values far away from each other have more different-appearing colors, consistently across the range of values, - **Robust to colorblindness**, so that the above properties hold true for people with common forms of colorblindness, as well as in grey scale printing, and - **Pretty**, oh so pretty If you want to know more about the science behind creating these color scales, van der Walt and Smith's [talk at SciPy 2015](https://www.youtube.com/watch?list=PLYx7XA2nY5Gcpabmu61kKcToLz0FapmHu&v=xAoljeRJ3lU) (YouTube) is quite interesting. On the project [website](http://bids.github.io/colormap/) you will find more details and a Python tool for creating other scales with similar properties. # The Color Scales The package contains four color scales: "Viridis", the primary choice, and three alternatives with similar properties, "magma", "plasma", and "inferno." ```{r for_repeat, include=FALSE} n_col <- 128 img <- function(obj, nam) { image(1:length(obj), 1, as.matrix(1:length(obj)), col=obj, main = nam, ylab = "", xaxt = "n", yaxt = "n", bty = "n") } ``` ```{r begin, message=FALSE, include=FALSE} library(viridis) library(scales) library(colorspace) library(dichromat) ``` ```{r show_scales, echo=FALSE,fig.height=3.575} par(mfrow=c(5, 1), mar=rep(1, 4)) img(rev(viridis(n_col)), "viridis") img(rev(magma(n_col)), "magma") img(rev(plasma(n_col)), "plasma") img(rev(inferno(n_col)), "inferno") img(rev(cividis(n_col)), "cividis") ``` # Comparison Let's compare the viridis and magma scales against these other commonly used sequential color palettes in R: - Base R palettes: `rainbow.colors`, `heat.colors`, `cm.colors` - The default **ggplot2** palette - Sequential [colorbrewer](http://colorbrewer2.org/) palettes, both default blues and the more viridis-like yellow-green-blue ```{r 01_normal, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(rev(rainbow(n_col)), "rainbow") img(rev(heat.colors(n_col)), "heat") img(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "ggplot default") img(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "brewer blues") img(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "brewer yellow-green-blue") img(rev(viridis(n_col)), "viridis") img(rev(magma(n_col)), "magma") ``` 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*. It makes as much use of the available color space as possible while maintaining uniformity. Now, let's compare these as they might appear under various forms of colorblindness, which can be simulated using the **[dichromat](https://cran.r-project.org/package=dichromat)** package: ### Green-Blind (Deuteranopia) ```{r 02_deutan, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "deutan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "deutan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "deutan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "deutan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "deutan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "deutan"), "viridis") img(dichromat(rev(magma(n_col)), "deutan"), "magma") ``` ### Red-Blind (Protanopia) ```{r 03_protan, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "protan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "protan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "protan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "protan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "protan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "protan"), "viridis") img(dichromat(rev(magma(n_col)), "protan"), "magma") ``` ### Blue-Blind (Tritanopia) ```{r 04_tritan, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "tritan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "tritan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "tritan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "tritan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "tritan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "tritan"), "viridis") img(dichromat(rev(magma(n_col)), "tritan"), "magma") ``` ### Desaturated ```{r 05_desatureated, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(desaturate(rev(rainbow(n_col))), "rainbow") img(desaturate(rev(heat.colors(n_col))), "heat") img(desaturate(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col)))), "ggplot default") img(desaturate(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col))), "brewer blues") img(desaturate(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col))), "brewer yellow-green-blue") img(desaturate(rev(viridis(n_col))), "viridis") img(desaturate(rev(magma(n_col))), "magma") ``` We can see that in these cases, "rainbow" is quite problematic - it is not perceptually consistent across its range. "Heat" washes out at bright colors, as do the brewer scales to a lesser extent. The ggplot scale does not wash out, but it has a low perceptual range - there's not much contrast between low and high values. The "viridis" and "magma" scales do better - they cover a wide perceptual range in brightness in brightness and blue-yellow, and do not rely as much on red-green contrast. They do less well under tritanopia (blue-blindness), but this is an extrememly rare form of colorblindness. # Usage The `viridis()` function produces the viridis color scale. You can choose the other color scale options using the `option` parameter or the convenience functions `magma()`, `plasma()`, and `inferno()`. Here the `inferno()` scale is used for a raster of U.S. max temperature: ```{r tempmap, message=FALSE} library(rasterVis) library(httr) par(mfrow=c(1,1), mar=rep(0.5, 4)) temp_raster <- "http://ftp.cpc.ncep.noaa.gov/GIS/GRADS_GIS/GeoTIFF/TEMP/us_tmax/us.tmax_nohads_ll_20150219_float.tif" try(GET(temp_raster, write_disk("us.tmax_nohads_ll_20150219_float.tif")), silent=TRUE) us <- raster("us.tmax_nohads_ll_20150219_float.tif") us <- projectRaster(us, crs="+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs") image(us, col=inferno(256), asp=1, axes=FALSE, xaxs="i", xaxt='n', yaxt='n', ann=FALSE) ``` The package also contains color scale functions for **ggplot** plots: `scale_color_viridis()` and `scale_fill_viridis()`. As with `viridis()`, you can use the other scales with the `option` argument in the `ggplot` scales. Here the "magma" scale is used for a cloropleth map of U.S. unemployment: ```{r, ggplot2} unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", header = FALSE, stringsAsFactors = FALSE) names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", "?", "?", "?", "rate") unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) county_df <- map_data("county", projection = "albers", parameters = c(39, 45)) names(county_df) <- c("long", "lat", "group", "order", "state_name", "county") county_df$state <- state.abb[match(county_df$state_name, tolower(state.name))] county_df$state_name <- NULL state_df <- map_data("state", projection = "albers", parameters = c(39, 45)) choropleth <- merge(county_df, unemp, by = c("state", "county")) choropleth <- choropleth[order(choropleth$order), ] ggplot(choropleth, aes(long, lat, group = group)) + geom_polygon(aes(fill = rate), colour = alpha("white", 1 / 2), size = 0.2) + geom_polygon(data = state_df, colour = "white", fill = NA) + coord_fixed() + theme_minimal() + ggtitle("US unemployment rate by county") + theme(axis.line = element_blank(), axis.text = element_blank(), axis.ticks = element_blank(), axis.title = element_blank()) + scale_fill_viridis(option="magma") ``` The ggplot functions also can be used for discrete scales with the argument `discrete=TRUE`. ```{r discrete} p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(size=4, aes(colour = factor(cyl))) + scale_color_viridis(discrete=TRUE) + theme_bw() ``` # Gallery Here are some examples of viridis being used in the wild: [James Curley](https://twitter.com/jalapic) uses **viridis** for matrix plots ([Code](https://gist.github.com/jalapic/9a1c069aa8cee4089c1e)): [![](http://pbs.twimg.com/media/CQWw9EgWsAAoUi0.png)](https://twitter.com/jalapic/status/650120284901634048/photo/1) [Jeff Hollister](https://twitter.com/jhollist) uses the viridis as a discrete categorical scale ([Code](http://github.com/USEPA/LakeTrophicModelling/blob/master/vignettes/manuscript.Rmd#cbpalette---c0072b2999999f0e442d55e00)): [![](http://github.com/USEPA/LakeTrophicModelling/blob/master/vignettes/manuscript_files/figure-latex/gis_probability_map-1.jpeg?raw=TRUE)](http://github.com/USEPA/LakeTrophicModelling/blob/master/vignettes/manuscript_files/figure-latex/gis_probability_map-1.jpeg) [Christopher Moore](https://twitter.com/lifedispersing) created these contour plots of potential in a dynamic plankton-consumer model: [![](http://pbs.twimg.com/media/CQWTy7wWcAAa-gu.jpg)](https://twitter.com/lifedispersing/status/650088228016508928/photo/1) viridis/inst/doc/intro-to-viridis.html0000644000176200001440001203332713257176614017604 0ustar liggesusers The viridis color palettes

The viridis color palettes

Bob Rudis, Noam Ross and Simon Garnier

2018-03-29

tl;dr

Use the color scales in this package to make plots that are pretty, better represent your data, easier to read by those with colorblindness, and print well in grey scale.

Install viridis like any R package:

install.packages("viridis")
library(viridis)

For base plots, use the viridis() function to generate a palette:

x <- y <- seq(-8*pi, 8*pi, len = 40)
r <- sqrt(outer(x^2, y^2, "+"))
filled.contour(cos(r^2)*exp(-r/(2*pi)), 
               axes=FALSE,
               color.palette=viridis,
               asp=1)

For ggplot, use scale_color_viridis() and scale_fill_viridis():

library(ggplot2)
ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) +
  geom_hex() + coord_fixed() +
  scale_fill_viridis() + theme_bw()

Introduction

The viridis package brings to R color scales created by Stéfan van der Walt and Nathaniel Smith for the Python matplotlib library.

These color scales are designed to be:

If you want to know more about the science behind creating these color scales, van der Walt and Smith’s talk at SciPy 2015 (YouTube) is quite interesting. On the project website you will find more details and a Python tool for creating other scales with similar properties.

The Color Scales

The package contains four color scales: “Viridis”, the primary choice, and three alternatives with similar properties, “magma”, “plasma”, and “inferno.”

Comparison

Let’s compare the viridis and magma scales against these other commonly used sequential color palettes in R:

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. It makes as much use of the available color space as possible while maintaining uniformity.

Now, let’s compare these as they might appear under various forms of colorblindness, which can be simulated using the dichromat package:

Green-Blind (Deuteranopia)

Red-Blind (Protanopia)

Blue-Blind (Tritanopia)

Desaturated

We can see that in these cases, “rainbow” is quite problematic - it is not perceptually consistent across its range. “Heat” washes out at bright colors, as do the brewer scales to a lesser extent. The ggplot scale does not wash out, but it has a low perceptual range - there’s not much contrast between low and high values. The “viridis” and “magma” scales do better - they cover a wide perceptual range in brightness in brightness and blue-yellow, and do not rely as much on red-green contrast. They do less well under tritanopia (blue-blindness), but this is an extrememly rare form of colorblindness.

Usage

The viridis() function produces the viridis color scale. You can choose the other color scale options using the option parameter or the convenience functions magma(), plasma(), and inferno().

Here the inferno() scale is used for a raster of U.S. max temperature:

library(rasterVis)
library(httr)
par(mfrow=c(1,1), mar=rep(0.5, 4))
temp_raster <- "http://ftp.cpc.ncep.noaa.gov/GIS/GRADS_GIS/GeoTIFF/TEMP/us_tmax/us.tmax_nohads_ll_20150219_float.tif"
try(GET(temp_raster,
        write_disk("us.tmax_nohads_ll_20150219_float.tif")), silent=TRUE)
us <- raster("us.tmax_nohads_ll_20150219_float.tif")
us <- projectRaster(us, crs="+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs")
image(us, col=inferno(256), asp=1, axes=FALSE, xaxs="i", xaxt='n', yaxt='n', ann=FALSE)

The package also contains color scale functions for ggplot plots: scale_color_viridis() and scale_fill_viridis(). As with viridis(), you can use the other scales with the option argument in the ggplot scales. Here the “magma” scale is used for a cloropleth map of U.S. unemployment:

unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv",
                  header = FALSE, stringsAsFactors = FALSE)
names(unemp) <- c("id", "state_fips", "county_fips", "name", "year",
                  "?", "?", "?", "rate")
unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name))
unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county)
unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name)

county_df <- map_data("county", projection = "albers", parameters = c(39, 45))
## 
## Attaching package: 'maps'
## The following object is masked _by_ '.GlobalEnv':
## 
##     unemp
names(county_df) <- c("long", "lat", "group", "order", "state_name", "county")
county_df$state <- state.abb[match(county_df$state_name, tolower(state.name))]
county_df$state_name <- NULL

state_df <- map_data("state", projection = "albers", parameters = c(39, 45))

choropleth <- merge(county_df, unemp, by = c("state", "county"))
choropleth <- choropleth[order(choropleth$order), ]

ggplot(choropleth, aes(long, lat, group = group)) +
  geom_polygon(aes(fill = rate), colour = alpha("white", 1 / 2), size = 0.2) +
  geom_polygon(data = state_df, colour = "white", fill = NA) +
  coord_fixed() +
  theme_minimal() +
  ggtitle("US unemployment rate by county") +
  theme(axis.line = element_blank(), axis.text = element_blank(),
        axis.ticks = element_blank(), axis.title = element_blank()) +
  scale_fill_viridis(option="magma")

The ggplot functions also can be used for discrete scales with the argument discrete=TRUE.

p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(size=4, aes(colour = factor(cyl))) +
    scale_color_viridis(discrete=TRUE) +
    theme_bw()

viridis/tests/0000755000176200001440000000000013065003116013060 5ustar liggesusersviridis/tests/figs/0000755000176200001440000000000013065003116014010 5ustar liggesusersviridis/tests/figs/colorandfill/0000755000176200001440000000000013065003116016460 5ustar liggesusersviridis/tests/figs/colorandfill/d.svg0000644000176200001440000007502013065003116017430 0ustar liggesusers 40 60 80 100 2 4 6 Virdis D 0.005 0.010 level d viridis/tests/figs/colorandfill/a.svg0000644000176200001440000007503413065003116017432 0ustar liggesusers 40 60 80 100 2 4 6 Virdis A 0.005 0.010 level a viridis/tests/figs/colorandfill/b.svg0000644000176200001440000007505413065003116017435 0ustar liggesusers 40 60 80 100 2 4 6 Virdis B 0.005 0.010 level b viridis/tests/figs/colorandfill/c.svg0000644000176200001440000007502413065003116017433 0ustar liggesusers 40 60 80 100 2 4 6 Virdis C 0.005 0.010 level c viridis/tests/figs/deps.txt0000644000176200001440000000005413065003116015503 0ustar liggesusersvdiffr: 0.1.1 svglite: 1.2.0 ggplot2: 2.2.1 viridis/tests/testthat.R0000644000176200001440000000015413065003116015043 0ustar liggesuserslibrary(testthat) library(viridis) library(ggplot2) library(MASS) library(gridExtra) test_check("viridis") viridis/tests/testthat/0000755000176200001440000000000013257205350014727 5ustar liggesusersviridis/tests/testthat/Rplots.pdf0000644000176200001440000011314713065003116016705 0ustar liggesusers%PDF-1.4 %ρ\r 1 0 obj << /CreationDate (D:20170304203650) /ModDate (D:20170304203650) /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oՉ@ϟD-ikLj8ՁdžӼJ[CRgKZl]~8lw@5W[y]o[ >w+ZVQg$3> j N{ٯWGE5Z3k!=ȋX+'TqT<믫d;^Z`L`ǬJƞޞ&2}`k`k>aklMzN} ?Zmmmﴵ^ZuomMɓ_?[/A[/wW8Qc}ߡwm%endstream endobj 9 0 obj << /Type /XObject /Subtype /Image /Width 1 /Height 25 /ColorSpace 5 0 R /BitsPerComponent 8 /Length 86 /Interpolate true /Filter /FlateDecode >> stream xKט‡wkas\`]QdEl=s6z1~+&raQ|?r,`G -"dendstream endobj 10 0 obj << /Type /XObject /Subtype /Image /Width 1 /Height 25 /ColorSpace 5 0 R /BitsPerComponent 8 /Length 86 /Interpolate true /Filter /FlateDecode >> stream xK{R2 zi%Y2L>@J6U/^(e"jxmhnWnE i3 ^! J 0^endstream endobj 11 0 obj << /Type /XObject /Subtype /Image /Width 1 /Height 25 /ColorSpace 5 0 R /BitsPerComponent 8 /Length 86 /Interpolate true /Filter /FlateDecode >> stream xK!&$(/8AJySk]_eSoGy;/# ~n]L;' P$endstream endobj 12 0 obj << /Type /XObject /Subtype /Image /Width 1 /Height 25 /ColorSpace 5 0 R /BitsPerComponent 8 /Length 86 /Interpolate true /Filter /FlateDecode >> stream xK% 2DuT]cGn5y' !$(|,r1h6];R@FD:G-{HpGdDTI Lendstream endobj 3 0 obj << /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 504 504] >> endobj 4 0 obj << /ProcSet [/PDF /Text /ImageC] /Font <> /XObject << /Im0 9 0 R /Im1 10 0 R /Im2 11 0 R /Im3 12 0 R >> /ExtGState << >> /ColorSpace << /sRGB 5 0 R >> >> endobj 5 0 obj [/ICCBased 6 0 R] endobj 6 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~endstream endobj 13 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 45/minus 96/quoteleft 144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] >> endobj 14 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica /Encoding 13 0 R >> endobj xref 0 15 0000000000 65535 f 0000000021 00000 n 0000000163 00000 n 0000034767 00000 n 0000034850 00000 n 0000035040 00000 n 0000035073 00000 n 0000000212 00000 n 0000000292 00000 n 0000033632 00000 n 0000033915 00000 n 0000034199 00000 n 0000034483 00000 n 0000037768 00000 n 0000038026 00000 n trailer << /Size 15 /Info 1 0 R /Root 2 0 R >> startxref 38124 %%EOF viridis/tests/testthat/test-viridis.R0000644000176200001440000000302313235067470017503 0ustar liggesuserscontext("scales") test_that("scales work correctly", { fill_scale <- scale_fill_viridis(option = "A") expect_equal(fill_scale$scale_name, "gradientn") fill_scale <- scale_fill_viridis(option = "A", discrete = TRUE) expect_equal(fill_scale$is_discrete(), TRUE) color_scale <- scale_color_viridis(option = "A") expect_equal(color_scale$scale_name, "gradientn") color_scale <- scale_color_viridis(option = "A", discrete = TRUE) expect_equal(color_scale$is_discrete(), TRUE) expect_equal(viridis_pal(1)(5), c("#440154FF", "#3B528BFF", "#21908CFF", "#5DC863FF", "#FDE725FF")) }) context("colorandfill") test_that("visual elements are correct", { skip_on_cran() library(ggplot2) library(MASS) library(gridExtra) data("geyser", package="MASS") ggplot(geyser, aes(x = duration, y = waiting)) + xlim(0.5, 6) + ylim(40, 110) + stat_density2d(aes(fill = ..level..), geom="polygon") + theme_bw() + theme(panel.grid=element_blank()) -> gg A <- gg + scale_fill_viridis(option="A") + labs(x="Virdis A", y=NULL) B <- gg + scale_fill_viridis(option="B") + labs(x="Virdis B", y=NULL) C <- gg + scale_fill_viridis(option="C") + labs(x="Virdis C", y=NULL) D <- gg + scale_fill_viridis(option="D") + labs(x="Virdis D", y=NULL) E <- gg + scale_fill_viridis(option="E") + labs(x="Virdis E", y=NULL) vdiffr::expect_doppelganger("a", A) vdiffr::expect_doppelganger("b", B) vdiffr::expect_doppelganger("c", C) vdiffr::expect_doppelganger("d", D) vdiffr::expect_doppelganger("e", E) }) viridis/NAMESPACE0000644000176200001440000000105513235067470013152 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(cividis) export(inferno) export(magma) export(plasma) export(scale_color_viridis) export(scale_colour_viridis) export(scale_fill_viridis) export(viridis) export(viridis.map) export(viridis_pal) importFrom(ggplot2,discrete_scale) importFrom(ggplot2,scale_color_gradientn) importFrom(ggplot2,scale_fill_gradientn) importFrom(gridExtra,grid.arrange) importFrom(viridisLite,cividis) importFrom(viridisLite,inferno) importFrom(viridisLite,magma) importFrom(viridisLite,plasma) importFrom(viridisLite,viridis) viridis/R/0000755000176200001440000000000012552041636012130 5ustar liggesusersviridis/R/compatibility.R0000644000176200001440000000125213235067470015127 0ustar liggesusers#' Original 'viridis'and 'cividis' color map #' #' A dataset containing the original RGB values of the default Matplotlib color #' map ('viridis') and the color vision deficiencies optimized color map #' 'cividis'. #' Sources: \url{https://github.com/BIDS/colormap/blob/master/option_d.py} and #' \url{https://github.com/pnnl/cmaputil/blob/master/colormaps/cividis.txt}. #' #' @format A data frame with 1280 rows and 4 variables: #' \itemize{ #' \item R: Red value #' \item G: Green value #' \item B: Blue value #' \item opt: The colormap "option" (A: magma; B: inferno; C: plasma; #' D: viridis; E: cividis) #' } #' #' @export viridis.map <- viridisLite::viridis.map viridis/R/scales.R0000644000176200001440000001333013235067470013530 0ustar liggesusers#' Viridis palette (discrete) #' #' Viridis palette (discrete) #' #' @details #' #' \if{html}{Here is an example of a 20-element palette: #' #' \out{
}\figure{sample-palette.png}{options: style="width:474px;max-width:90\%;"}\out{
} #' #' } #' \if{latex}{Here is an example of a 20-element palette: #' #' \out{\begin{center}}\figure{samplepalette.pdf}\out{\end{center}} #' } #' #' See \link[viridisLite]{viridis} for more information on the color scale. #' #' @param alpha pass through parameter to \code{viridis} #' #' @param begin The (corrected) hue in [0,1] at which the viridis colormap begins. #' #' @param end The (corrected) hue in [0,1] at which the viridis colormap ends. #' #' @param direction Sets the order of colors in the scale. If 1, the default, colors #' are ordered from darkest to lightest. If -1, the order of colors is reversed. #' #' @param option A character string indicating the colormap option to use. Four #' options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), #' "viridis" (or "D", the default option) and "cividis" (or "E"). #' #' @author Bob Rudis \email{bob@@rud.is} #' #' @examples #' library(scales) #' show_col(viridis_pal()(10)) #' #' @importFrom viridisLite viridis #' #' @export viridis_pal <- function(alpha = 1, begin = 0, end = 1, direction = 1, option= "D") { function(n) { viridisLite::viridis(n, alpha, begin, end, direction, option) } } #' @rdname scale_viridis #' #' @importFrom ggplot2 scale_fill_gradientn scale_color_gradientn discrete_scale #' #' @export scale_color_viridis <- function(..., alpha = 1, begin = 0, end = 1, direction = 1, discrete = FALSE, option = "D") { if (discrete) { discrete_scale("colour", "viridis", viridis_pal(alpha, begin, end, direction, option), ...) } else { scale_color_gradientn(colours = viridisLite::viridis(256, alpha, begin, end, direction, option), ...) } } #' @rdname scale_viridis #' @aliases scale_color_viridis #' @export scale_colour_viridis <- scale_color_viridis #' Viridis color scales #' #' Uses the viridis color scale. #' #' For \code{discrete == FALSE} (the default) all other arguments are as to #' \link[ggplot2]{scale_fill_gradientn} or \link[ggplot2]{scale_color_gradientn}. #' Otherwise the function will return a \code{discrete_scale} with the plot-computed #' number of colors. #' #' See \link[viridisLite]{viridis} for more information on the color scale. #' #' @param ... parameters to \code{discrete_scale} or \code{scale_fill_gradientn} #' #' @param alpha pass through parameter to \code{viridis} #' #' @param begin The (corrected) hue in [0,1] at which the viridis colormap begins. #' #' @param end The (corrected) hue in [0,1] at which the viridis colormap ends. #' #' @param direction Sets the order of colors in the scale. If 1, the default, colors #' are as output by \link[viridis]{viridis_pal}. If -1, the order of colors is reversed. #' #' @param discrete generate a discrete palette? (default: \code{FALSE} - generate continuous palette) #' #' @param option A character string indicating the colormap option to use. Four #' options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), #' "viridis" (or "D", the default option) and "cividis" (or "E"). #' #' @rdname scale_viridis #' #' @author Noam Ross \email{noam.ross@@gmail.com} / \href{https://twitter.com/noamross}{@@noamross} (continuous version), #' Bob Rudis \email{bob@@rud.is} / \href{https://twitter.com/hrbrmstr}{@@hrbrmstr} (combined version) #' #' @importFrom ggplot2 scale_fill_gradientn scale_color_gradientn discrete_scale #' #' @importFrom gridExtra grid.arrange #' #' @examples #' library(ggplot2) #' #' # ripped from the pages of ggplot2 #' p <- ggplot(mtcars, aes(wt, mpg)) #' p + geom_point(size=4, aes(colour = factor(cyl))) + #' scale_color_viridis(discrete=TRUE) + #' theme_bw() #' #' # ripped from the pages of ggplot2 #' dsub <- subset(diamonds, x > 5 & x < 6 & y > 5 & y < 6) #' dsub$diff <- with(dsub, sqrt(abs(x-y))* sign(x-y)) #' d <- ggplot(dsub, aes(x, y, colour=diff)) + geom_point() #' d + scale_color_viridis() + theme_bw() #' #' #' # from the main viridis example #' dat <- data.frame(x = rnorm(10000), y = rnorm(10000)) #' #' ggplot(dat, aes(x = x, y = y)) + #' geom_hex() + coord_fixed() + #' scale_fill_viridis() + theme_bw() #' #' library(ggplot2) #' library(MASS) #' library(gridExtra) #' #' data("geyser", package="MASS") #' #' ggplot(geyser, aes(x = duration, y = waiting)) + #' xlim(0.5, 6) + ylim(40, 110) + #' stat_density2d(aes(fill = ..level..), geom="polygon") + #' theme_bw() + #' theme(panel.grid=element_blank()) -> gg #' #' grid.arrange( #' gg + scale_fill_viridis(option="A") + labs(x="Virdis A", y=NULL), #' gg + scale_fill_viridis(option="B") + labs(x="Virdis B", y=NULL), #' gg + scale_fill_viridis(option="C") + labs(x="Virdis C", y=NULL), #' gg + scale_fill_viridis(option="D") + labs(x="Virdis D", y=NULL), #' gg + scale_fill_viridis(option="E") + labs(x="Virdis E", y=NULL), #' ncol=3, nrow=2 #' ) #' #' @export scale_fill_viridis <- function(..., alpha = 1, begin = 0, end = 1, direction = 1, discrete = FALSE, option = "D") { if (discrete) { discrete_scale("fill", "viridis", viridis_pal(alpha, begin, end, direction, option), ...) } else { scale_fill_gradientn(colours = viridisLite::viridis(256, alpha, begin, end, direction, option), ...) } } #' @importFrom viridisLite viridis #' @export viridisLite::viridis #' @importFrom viridisLite inferno #' @export viridisLite::inferno #' @importFrom viridisLite magma #' @export viridisLite::magma #' @importFrom viridisLite plasma #' @export viridisLite::plasma #' @importFrom viridisLite cividis #' @export viridisLite::cividis viridis/vignettes/0000755000176200001440000000000013257176614013747 5ustar liggesusersviridis/vignettes/intro-to-viridis.Rmd0000644000176200001440000002755013235067470017641 0ustar liggesusers--- title: "The viridis color palettes" author: - "Bob Rudis, Noam Ross and Simon Garnier" date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true toc_depth: 1 vignette: > %\VignetteIndexEntry{Intro to the viridis color palette} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- # tl;dr Use the color scales in this package to make plots that are pretty, better represent your data, easier to read by those with colorblindness, and print well in grey scale. Install **viridis** like any R package: ``` install.packages("viridis") library(viridis) ``` For base plots, use the `viridis()` function to generate a palette: ```{r setup, include=FALSE} library(viridis) knitr::opts_chunk$set(echo = TRUE, fig.retina=2, fig.width=7, fig.height=5) ``` ```{r tldr_base, message=FALSE} x <- y <- seq(-8*pi, 8*pi, len = 40) r <- sqrt(outer(x^2, y^2, "+")) filled.contour(cos(r^2)*exp(-r/(2*pi)), axes=FALSE, color.palette=viridis, asp=1) ``` For ggplot, use `scale_color_viridis()` and `scale_fill_viridis()`: ```{r, tldr_ggplot, message=FALSE} library(ggplot2) ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_viridis() + theme_bw() ``` # Introduction The [**viridis**](https://cran.r-project.org/package=viridis) package brings to R color scales created by [Stéfan van der Walt](https://github.com/stefanv) and [Nathaniel Smith](https://github.com/njsmith) for the Python **matplotlib** library. These color scales are designed to be: - **Colorful**, spanning as wide a palette as possible so as to make differences easy to see, - **Perceptually uniform**, meaning that values close to each other have similar-appearing colors and values far away from each other have more different-appearing colors, consistently across the range of values, - **Robust to colorblindness**, so that the above properties hold true for people with common forms of colorblindness, as well as in grey scale printing, and - **Pretty**, oh so pretty If you want to know more about the science behind creating these color scales, van der Walt and Smith's [talk at SciPy 2015](https://www.youtube.com/watch?list=PLYx7XA2nY5Gcpabmu61kKcToLz0FapmHu&v=xAoljeRJ3lU) (YouTube) is quite interesting. On the project [website](http://bids.github.io/colormap/) you will find more details and a Python tool for creating other scales with similar properties. # The Color Scales The package contains four color scales: "Viridis", the primary choice, and three alternatives with similar properties, "magma", "plasma", and "inferno." ```{r for_repeat, include=FALSE} n_col <- 128 img <- function(obj, nam) { image(1:length(obj), 1, as.matrix(1:length(obj)), col=obj, main = nam, ylab = "", xaxt = "n", yaxt = "n", bty = "n") } ``` ```{r begin, message=FALSE, include=FALSE} library(viridis) library(scales) library(colorspace) library(dichromat) ``` ```{r show_scales, echo=FALSE,fig.height=3.575} par(mfrow=c(5, 1), mar=rep(1, 4)) img(rev(viridis(n_col)), "viridis") img(rev(magma(n_col)), "magma") img(rev(plasma(n_col)), "plasma") img(rev(inferno(n_col)), "inferno") img(rev(cividis(n_col)), "cividis") ``` # Comparison Let's compare the viridis and magma scales against these other commonly used sequential color palettes in R: - Base R palettes: `rainbow.colors`, `heat.colors`, `cm.colors` - The default **ggplot2** palette - Sequential [colorbrewer](http://colorbrewer2.org/) palettes, both default blues and the more viridis-like yellow-green-blue ```{r 01_normal, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(rev(rainbow(n_col)), "rainbow") img(rev(heat.colors(n_col)), "heat") img(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "ggplot default") img(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "brewer blues") img(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "brewer yellow-green-blue") img(rev(viridis(n_col)), "viridis") img(rev(magma(n_col)), "magma") ``` 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*. It makes as much use of the available color space as possible while maintaining uniformity. Now, let's compare these as they might appear under various forms of colorblindness, which can be simulated using the **[dichromat](https://cran.r-project.org/package=dichromat)** package: ### Green-Blind (Deuteranopia) ```{r 02_deutan, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "deutan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "deutan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "deutan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "deutan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "deutan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "deutan"), "viridis") img(dichromat(rev(magma(n_col)), "deutan"), "magma") ``` ### Red-Blind (Protanopia) ```{r 03_protan, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "protan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "protan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "protan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "protan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "protan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "protan"), "viridis") img(dichromat(rev(magma(n_col)), "protan"), "magma") ``` ### Blue-Blind (Tritanopia) ```{r 04_tritan, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(dichromat(rev(rainbow(n_col)), "tritan"), "rainbow") img(dichromat(rev(heat.colors(n_col)), "tritan"), "heat") img(dichromat(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col))), "tritan"), "ggplot default") img(dichromat(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col)), "tritan"), "brewer blues") img(dichromat(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col)), "tritan"), "brewer yellow-green-blue") img(dichromat(rev(viridis(n_col)), "tritan"), "viridis") img(dichromat(rev(magma(n_col)), "tritan"), "magma") ``` ### Desaturated ```{r 05_desatureated, echo=FALSE} par(mfrow=c(7, 1), mar=rep(1, 4)) img(desaturate(rev(rainbow(n_col))), "rainbow") img(desaturate(rev(heat.colors(n_col))), "heat") img(desaturate(rev(seq_gradient_pal(low = "#132B43", high = "#56B1F7", space = "Lab")(seq(0, 1, length=n_col)))), "ggplot default") img(desaturate(gradient_n_pal(brewer_pal(type="seq")(9))(seq(0, 1, length=n_col))), "brewer blues") img(desaturate(gradient_n_pal(brewer_pal(type="seq", palette = "YlGnBu")(9))(seq(0, 1, length=n_col))), "brewer yellow-green-blue") img(desaturate(rev(viridis(n_col))), "viridis") img(desaturate(rev(magma(n_col))), "magma") ``` We can see that in these cases, "rainbow" is quite problematic - it is not perceptually consistent across its range. "Heat" washes out at bright colors, as do the brewer scales to a lesser extent. The ggplot scale does not wash out, but it has a low perceptual range - there's not much contrast between low and high values. The "viridis" and "magma" scales do better - they cover a wide perceptual range in brightness in brightness and blue-yellow, and do not rely as much on red-green contrast. They do less well under tritanopia (blue-blindness), but this is an extrememly rare form of colorblindness. # Usage The `viridis()` function produces the viridis color scale. You can choose the other color scale options using the `option` parameter or the convenience functions `magma()`, `plasma()`, and `inferno()`. Here the `inferno()` scale is used for a raster of U.S. max temperature: ```{r tempmap, message=FALSE} library(rasterVis) library(httr) par(mfrow=c(1,1), mar=rep(0.5, 4)) temp_raster <- "http://ftp.cpc.ncep.noaa.gov/GIS/GRADS_GIS/GeoTIFF/TEMP/us_tmax/us.tmax_nohads_ll_20150219_float.tif" try(GET(temp_raster, write_disk("us.tmax_nohads_ll_20150219_float.tif")), silent=TRUE) us <- raster("us.tmax_nohads_ll_20150219_float.tif") us <- projectRaster(us, crs="+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs") image(us, col=inferno(256), asp=1, axes=FALSE, xaxs="i", xaxt='n', yaxt='n', ann=FALSE) ``` The package also contains color scale functions for **ggplot** plots: `scale_color_viridis()` and `scale_fill_viridis()`. As with `viridis()`, you can use the other scales with the `option` argument in the `ggplot` scales. Here the "magma" scale is used for a cloropleth map of U.S. unemployment: ```{r, ggplot2} unemp <- read.csv("http://datasets.flowingdata.com/unemployment09.csv", header = FALSE, stringsAsFactors = FALSE) names(unemp) <- c("id", "state_fips", "county_fips", "name", "year", "?", "?", "?", "rate") unemp$county <- tolower(gsub(" County, [A-Z]{2}", "", unemp$name)) unemp$county <- gsub("^(.*) parish, ..$","\\1", unemp$county) unemp$state <- gsub("^.*([A-Z]{2}).*$", "\\1", unemp$name) county_df <- map_data("county", projection = "albers", parameters = c(39, 45)) names(county_df) <- c("long", "lat", "group", "order", "state_name", "county") county_df$state <- state.abb[match(county_df$state_name, tolower(state.name))] county_df$state_name <- NULL state_df <- map_data("state", projection = "albers", parameters = c(39, 45)) choropleth <- merge(county_df, unemp, by = c("state", "county")) choropleth <- choropleth[order(choropleth$order), ] ggplot(choropleth, aes(long, lat, group = group)) + geom_polygon(aes(fill = rate), colour = alpha("white", 1 / 2), size = 0.2) + geom_polygon(data = state_df, colour = "white", fill = NA) + coord_fixed() + theme_minimal() + ggtitle("US unemployment rate by county") + theme(axis.line = element_blank(), axis.text = element_blank(), axis.ticks = element_blank(), axis.title = element_blank()) + scale_fill_viridis(option="magma") ``` The ggplot functions also can be used for discrete scales with the argument `discrete=TRUE`. ```{r discrete} p <- ggplot(mtcars, aes(wt, mpg)) p + geom_point(size=4, aes(colour = factor(cyl))) + scale_color_viridis(discrete=TRUE) + theme_bw() ``` # Gallery Here are some examples of viridis being used in the wild: [James Curley](https://twitter.com/jalapic) uses **viridis** for matrix plots ([Code](https://gist.github.com/jalapic/9a1c069aa8cee4089c1e)): [![](http://pbs.twimg.com/media/CQWw9EgWsAAoUi0.png)](https://twitter.com/jalapic/status/650120284901634048/photo/1) [Jeff Hollister](https://twitter.com/jhollist) uses the viridis as a discrete categorical scale ([Code](http://github.com/USEPA/LakeTrophicModelling/blob/master/vignettes/manuscript.Rmd#cbpalette---c0072b2999999f0e442d55e00)): [![](http://github.com/USEPA/LakeTrophicModelling/blob/master/vignettes/manuscript_files/figure-latex/gis_probability_map-1.jpeg?raw=TRUE)](http://github.com/USEPA/LakeTrophicModelling/blob/master/vignettes/manuscript_files/figure-latex/gis_probability_map-1.jpeg) [Christopher Moore](https://twitter.com/lifedispersing) created these contour plots of potential in a dynamic plankton-consumer model: [![](http://pbs.twimg.com/media/CQWTy7wWcAAa-gu.jpg)](https://twitter.com/lifedispersing/status/650088228016508928/photo/1) viridis/vignettes/us.tmax_nohads_ll_20150219_float.tif0000644000176200001440000012004412604545755022247 0ustar liggesusersII*ta57@8Ű8)8jU6a69^.;#0;2^<;;#6;㫥:s9 8)6|69 1;C&;K;=<1<fG>j==`h=C=_'>\r>>́>R >NMȾ3-5߷& <;c:9:(/:֌:|;;&=<態<};`:[G`V&,Xj;p]g^ĞfKj!N/)r"ǹN{n7K:٬2<,=/>>>!'?ҥ?$,?|_?`?l.><>Zz>3>ov>8 >!>X>>>@(>%p>%2?Iʋ???v?u?:X?Xn#CI" <9>T=>=k_ψ===e_=z<Y9#s䘿¿O+ֿ۱G  gV(Kv2sv][K!^ ١ͩߺ.גur9SD;<>w ?=?ݣ?@Vm@q@-@P@S?;K?Bb?-Е?x?u?ؠa?;c?z?މ??Ψ?ty@'D@ L@w~@,@6p@?<ȴU"4z̿>'G?RG?5>q>> 2>?s> {>؋>]>>:>y&Ɩ??@je@;@ ؜@ @@@@_t@h@eZ@|8F@3@[$@.@@'@]9@E@R@eq@@ن@@t@@KV@?[yͿ{?~¿L ?c?7@J?,E?%?/?dD?7???>H>.38rveuc.b%Nd3G k| hտBn!ǿZ0H)ݩ-uJ ˠ:V8 Y~5ջ{B˓).{Z93?Y@b@L@@@Xx@R@@@0p@ݏ@@Ҿ@{o@{\@PN@NO@ѳ`@Ԯw@魅@^@ޑ@?@NJ@Մ@[hm@q/@ݎ?RUe࿱b{?+@?@ @7?f?*O?S??az?UG?ܭ?>y|T$Ijԇ`3>2q *D Z #jv[ã:hU#8 ׋ƾx Z/<1{:tC1ԗ gqw=y}!aNeQ\$^!L_7VtN8 7;c=a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AZ4WA1ZA5WADIAt,A%WA%@8?.2>T<-8,x;=P?;9@s@'@ A{A,i!Ax&A\(A&A_"AAnA}@g?*>+7ɠ?}yB@G@;AAtAyMAiAv"@tM@/?8><_tb: 06C9u59R?@g@@H@AAUAw9A~ AYe@, @E @@%.V?_=k;\]7y:<>zT?Z?+/@^@|g@5a@E7@"\??5><2:m74?:Flv<~Y=>Ru?R @-u@@@@oa@Z@m@do@Y?A3>^|O>L>?>O>ѫ1>x9=f6l?@BJ%@)@v#@4@9v?2۴>`&=~<{E:a :;ΏvQ>>+^>>T=7v<;9"Z7o:;.;RIQM4̰~3A=J4 ]/D(viridis/DESCRIPTION0000644000176200001440000000375613257205350013446 0ustar liggesusersPackage: viridis Type: Package Title: Default Color Maps from 'matplotlib' Version: 0.5.1 Authors@R: c( person("Simon", "Garnier", email = "garnier@njit.edu", role = c("aut", "cre")), person("Noam", "Ross", email = "noam.ross@gmail.com", role = c("ctb", "cph")), person("Bob", "Rudis", email = "bob@rud.is", role = c("ctb", "cph")), person("Marco", "Sciaini", email = "sciaini.marco@gmail.com", role = c("ctb", "cph")), person("Cédric", "Scherer", email = "scherer@izw-berlin.de", role = c("ctb", "cph")) ) Maintainer: Simon Garnier Description: Implementation of the 'viridis' - the default -, 'magma', 'plasma', 'inferno', and 'cividis' color maps for 'R'. 'viridis', 'magma', 'plasma', and 'inferno' are ported from 'matplotlib' , a popular plotting library for 'python'. 'cividis', was developed by Jamie R. Nuñez and Sean M. Colby. These color maps are designed in such a way that they will analytically be perfectly perceptually-uniform, both in regular form and also when converted to black-and-white. They are also designed to be perceived by readers with the most common form of color blindness (all color maps in this package) and color vision deficiency ('cividis' only). License: MIT + file LICENSE LazyData: TRUE Encoding: UTF-8 Depends: R (>= 2.10), viridisLite (>= 0.3.0) Imports: stats, ggplot2 (>= 1.0.1), gridExtra Suggests: hexbin (>= 1.27.0), scales, MASS, knitr, dichromat, colorspace, rasterVis, httr, mapproj, vdiffr, svglite (>= 1.2.0), testthat, covr, rmarkdown, rgdal VignetteBuilder: knitr URL: https://github.com/sjmgarnier/viridis BugReports: https://github.com/sjmgarnier/viridis/issues RoxygenNote: 6.0.1 NeedsCompilation: no Packaged: 2018-03-29 14:51:56 UTC; simon Author: Simon Garnier [aut, cre], Noam Ross [ctb, cph], Bob Rudis [ctb, cph], Marco Sciaini [ctb, cph], Cédric Scherer [ctb, cph] Repository: CRAN Date/Publication: 2018-03-29 15:48:56 UTC viridis/man/0000755000176200001440000000000012552041636012502 5ustar liggesusersviridis/man/viridis_pal.Rd0000644000176200001440000000256613235067470015312 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scales.R \name{viridis_pal} \alias{viridis_pal} \title{Viridis palette (discrete)} \usage{ viridis_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = "D") } \arguments{ \item{alpha}{pass through parameter to \code{viridis}} \item{begin}{The (corrected) hue in [0,1] at which the viridis colormap begins.} \item{end}{The (corrected) hue in [0,1] at which the viridis colormap ends.} \item{direction}{Sets the order of colors in the scale. If 1, the default, colors are ordered from darkest to lightest. If -1, the order of colors is reversed.} \item{option}{A character string indicating the colormap option to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E").} } \description{ Viridis palette (discrete) } \details{ \if{html}{Here is an example of a 20-element palette: \out{

}\figure{sample-palette.png}{options: style="width:474px;max-width:90\%;"}\out{
} } \if{latex}{Here is an example of a 20-element palette: \out{\begin{center}}\figure{samplepalette.pdf}\out{\end{center}} } See \link[viridisLite]{viridis} for more information on the color scale. } \examples{ library(scales) show_col(viridis_pal()(10)) } \author{ Bob Rudis \email{bob@rud.is} } viridis/man/figures/0000755000176200001440000000000012652414337014151 5ustar liggesusersviridis/man/figures/sample-palette.png0000644000176200001440000012734212652414337017605 0ustar liggesusersPNG  IHDR > iCCPICC Profile8U]hU>sg#$Sl4t? % V46nI6"dΘ83OEP|1Ŀ (>/ % (>P苦;3ie|{g蹪X-2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'S5&&OnKDk&QA@:$rBA@h>hKIA@mH  |6R  P!: A@Am>,&A@ABu  @! D|XJM @h@"'A@C`YIENDB`viridis/man/figures/samplepalette.pdf0000644000176200001440000001100012652414337017474 0ustar liggesusers%PDF-1.4 %ρ\r 1 0 obj << /CreationDate (D:20160105135430) /ModDate (D:20160105135430) /Title (R Graphics Output) /Producer (R 3.3.0) /Creator (R) >> endobj 2 0 obj << /Type /Catalog /Pages 3 0 R >> endobj ET Q q 7 0 obj << /Type /Page /Parent 3 0 R /Contents 8 0 R /Resources 4 0 R >> endobj 8 0 obj << /Length 663 /Filter /FlateDecode >> stream xVn1 WD8ERa%SJT*=ɴd߳ߋ,K>޵wQa{n+w9oowgATCL%tŐK KYyQM~_ip0@ c$Lc2BvoCO2dhjT9(E W(PqQĠd rZc@ʃKX+dlQX#fC-:<2jlP\o(7tA2V+Ԗhk+6 u^W*,ɰРtPv},ɖ.N6ꪨ ]muW^hRrG7*jKWސJG-KVږdAӇ jCEr>uVt<1X9(oU]p: rǟ+"LwG~G6* f{ 49e%aYyK*i=< ?=U }$˾t=-'Hė[1 t$sZ{"iDI'TiJ]moSyyGT'HI r E1OwECüO1jW!endstream endobj 3 0 obj << /Type /Pages /Kids [ 7 0 R ] /Count 1 /MediaBox [0 0 686 368] >> endobj 4 0 obj << /ProcSet [/PDF /Text] /Font <> /ExtGState << >> /ColorSpace << /sRGB 5 0 R >> >> endobj 5 0 obj [/ICCBased 6 0 R] endobj 6 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~endstream endobj 9 0 obj << /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [ 45/minus 96/quoteleft 144/dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space] >> endobj 10 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica /Encoding 9 0 R >> endobj xref 0 11 0000000000 65535 f 0000000021 00000 n 0000000163 00000 n 0000001033 00000 n 0000001116 00000 n 0000001228 00000 n 0000001261 00000 n 0000000219 00000 n 0000000299 00000 n 0000003956 00000 n 0000004213 00000 n trailer << /Size 11 /Info 1 0 R /Root 2 0 R >> startxref 4310 %%EOF viridis/man/figures/viridis-scales.png0000644000176200001440000003323613235067470017607 0ustar liggesusersPNG  IHDR@! pHYse IDATx{Ue?ߎ/\P bH $|LJ}&C(h(2IH`j\Ngcww>;}>{뽬u{Z{\XL&= }gٲew,^!~Æ $@x@ƞp^zM:5-ׯ{@9tMdСk֬i\BGw-~լZ`AoOdť%˖-KW;J 7mڴm۶ /ss=\Ԯ]Mַoߖ-[gUUU0Ú5k&O:uq-[l޼y۷Oz (~ꫯNK,2eJ$K.M$I裏v!ٳB޽-ZԲe$I&M?fʴ6m 6sw={2 p{˗/Oj'vZˮod7|tK.I{jĉSLy[Gi7߿'O'ze˖]vI4m .}?[\'ϗ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>\3fLþ}9眍7|+V.]zח۷/|ʕ( ?֭[_cǎ/k֬ҥK$b 48qbZ,]u^x!-3y]v>:uq-[l޼y۷Oz 3ܢEBu1IC^{?{9\w~ҥi!ٳg޽{/ZhȐ!۷4iR(}Q?5m4-6l̙\r%\ҳgZvԙiӦpyr/| OՇk޻wѣG/_]oY:i%lٲT5q)SңGoO;vرcLҤpxk׮/iW^5:u4:tt2iҤ裏[B5~qլj֬ٱ[Mӫ$)˗/Fѳg/}Kk׮M'@xhX(b:?~뭷-[v۷'IҴi . 0ϗ5OJÇ1bڵW]uUnj.swIlݺΫ/~qef:uf͚5k֬ӧnz׿ү7k젯NwWv=-w};wرӳ\n̙t3H˅B!IO?sεSNizʔ)+W,]VQQbŊ ?~Ȑ!;vlٲ;f̘ogϞ Pg: p8 곳=':lm!ѼXljZ(6_  -MP N! \1n܉;+(o@eR(j$)]s 8nm`=g>؟YmبPe:68nbFۆ亷zoX#l[zvۖ1n1Hקi[ Y!dxb1tY=5Tdl>x ?13z.owns*2^r9I`aݟ )ۖS<~# %6 5 & x < 6 & y > 5 & y < 6) dsub$diff <- with(dsub, sqrt(abs(x-y))* sign(x-y)) d <- ggplot(dsub, aes(x, y, colour=diff)) + geom_point() d + scale_color_viridis() + theme_bw() # from the main viridis example dat <- data.frame(x = rnorm(10000), y = rnorm(10000)) ggplot(dat, aes(x = x, y = y)) + geom_hex() + coord_fixed() + scale_fill_viridis() + theme_bw() library(ggplot2) library(MASS) library(gridExtra) data("geyser", package="MASS") ggplot(geyser, aes(x = duration, y = waiting)) + xlim(0.5, 6) + ylim(40, 110) + stat_density2d(aes(fill = ..level..), geom="polygon") + theme_bw() + theme(panel.grid=element_blank()) -> gg grid.arrange( gg + scale_fill_viridis(option="A") + labs(x="Virdis A", y=NULL), gg + scale_fill_viridis(option="B") + labs(x="Virdis B", y=NULL), gg + scale_fill_viridis(option="C") + labs(x="Virdis C", y=NULL), gg + scale_fill_viridis(option="D") + labs(x="Virdis D", y=NULL), gg + scale_fill_viridis(option="E") + labs(x="Virdis E", y=NULL), ncol=3, nrow=2 ) } \author{ Noam Ross \email{noam.ross@gmail.com} / \href{https://twitter.com/noamross}{@noamross} (continuous version), Bob Rudis \email{bob@rud.is} / \href{https://twitter.com/hrbrmstr}{@hrbrmstr} (combined version) } viridis/LICENSE0000644000176200001440000000005312552561530012732 0ustar liggesusersYEAR: 2015 COPYRIGHT HOLDER: Simon Garnier