Using viridis
scales
   get_help()
docs
All functions documented here are part of the {ggplot2}
package, which is part of the {tidyverse}
.
The {ggplot2}
package provides several useful functions for specifying viridis
color/fill palettes for your color/fill aesthetic mapping scales. For more information on using this function to customize your theme, please either…
{introverse}
websiteR
Console: vignette("color_fill_scales", package = "introverse")
Briefly, there are four possible functions you might want to use depending on whether you are specifying a color or a fill, and type of variable being aesthetically mapped. To reverse the direction of any scale, include the optional argument direction = -1
.
Aesthetic | Mapped variable type | ggplot2 function |
---|---|---|
Color | Discrete/categorical | scale_color_viridis_d(option = 'name of viridis palette') |
Color | Continuous | scale_color_distiller_c(option = 'name of viridis palette') |
Fill | Discrete/categorical | scale_fill_viridis_d(option = 'name of viridis palette') |
Fill | Continuous | scale_fill_viridis_c(option = 'name of viridis palette') |
The available viridis
palettes include the following: