scale_viridis | R Documentation |
The 'viridis' scales provide colour maps that are perceptually uniform in both colour and black-and-white. They are also designed to be perceived by viewers with common forms of colour blindness. See also <https://bids.github.io/colormap/>.
scale_shadowcolour_viridis_d( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", aesthetics = "shadowcolour" ) scale_shadowcolour_viridis_c( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", values = NULL, space = "Lab", na.value = "grey50", guide = "colourbar", aesthetics = "shadowcolour" ) scale_shadowcolour_viridis_b( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", values = NULL, space = "Lab", na.value = "grey50", guide = "coloursteps", aesthetics = "shadowcolour" ) scale_shadowcolour_ordinal( ..., alpha = 1, begin = 0, end = 1, direction = 1, option = "D", aesthetics = "shadowcolour" )
... |
Other arguments passed on to [discrete_scale()], [continuous_scale()], or [binned_scale] to control name, limits, breaks, labels and so forth. |
alpha |
The alpha transparency, a number in [0,1], see argument alpha in
|
begin, end |
The (corrected) hue in |
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:
|
aesthetics |
Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the 'colour' and 'fill' aesthetics at the same time, via 'aesthetics = c("colour", "fill")'. |
values |
if colours should not be evenly positioned along the gradient
this vector gives the position (between 0 and 1) for each colour in the
|
space |
colour space in which to calculate gradient. Must be "Lab" - other values are deprecated. |
na.value |
Missing values will be replaced with this value. |
guide |
A function used to create a guide or its name. See
|
a scale object to add to a plot.
Other colour scales:
scale_brewer
,
scale_colour_hue
,
scale_colour_steps
,
scale_gradient
,
scale_grey
library( ggplot2 ) p <- ggplot(mtcars, aes(wt, mpg, shadowcolour=as.factor(gear))) p + geom_glowpoint() + scale_shadowcolour_viridis_d() + guides(shadowcolour='none') library( ggplot2 ) p <- ggplot(mtcars, aes(wt, mpg, shadowcolour=gear)) p + geom_glowpoint() + scale_shadowcolour_viridis_c() + guides(shadowcolour='none') library( ggplot2 ) p <- ggplot(mtcars, aes(wt, mpg, shadowcolour=gear)) p + geom_glowpoint() + scale_shadowcolour_viridis_b() + guides(shadowcolour='none') library( ggplot2 ) p <- ggplot(mtcars, aes(wt, mpg, shadowcolour=as.factor(gear))) p + geom_glowpoint() + scale_shadowcolour_ordinal() + guides(shadowcolour='none')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.