Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

viridis_pal

Viridis Color Palettes


Description

A wrapper function around viridis to turn it into a palette function compatible with discrete_scale.

Usage

viridis_pal(alpha = 1, begin = 0, end = 1, direction = 1, option = "D")

Arguments

alpha

The alpha transparency, a number in [0,1], see argument alpha in hsv.

begin

The (corrected) hue in [0,1] at which the color map begins.

end

The (corrected) hue in [0,1] at which the color map ends.

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.

option

A character string indicating the color map option to use. Eight options are available:

  • "magma" (or "A")

  • "inferno" (or "B")

  • "plasma" (or "C")

  • "viridis" (or "D")

  • "cividis" (or "E")

  • "rocket" (or "F")

  • "mako" (or "G")

  • "turbo" (or "H")

Details

See viridis and viridis.map for more information on the color palettes.

Author(s)

Bob Rudis: bob@rud.is / @hrbrmstr

Simon Garnier: garnier@njit.edu / @sjmgarnier

Examples

library(scales)
show_col(viridis_pal()(12))

viridis

Colorblind-Friendly Color Maps for R

v0.6.1
MIT + file LICENSE
Authors
Simon Garnier [aut, cre], Noam Ross [ctb, cph], Bob Rudis [ctb, cph], Marco Sciaini [ctb, cph], Antônio Pedro Camargo [ctb, cph], Cédric Scherer [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.