View source: R/scale-color-add-on.R
scale_color_add_on | R Documentation |
A wrapper around a variety of scale_color_-() / scale_fill_-()
functions.
scale_color_add_on(
aes = "color",
variable = NULL,
clrsp = NULL,
clrp = NULL,
clrp.adjust = NULL,
color.trans = "identity",
...
)
aes |
Character value. Either 'color' or 'fill'. Denotes the used aesthetic. |
variable |
The variable that is mapped onto the denoted aesthetic or a character value - one of 'numeric', 'discrete'. |
clrsp |
Character value. The color spectrum of choice. Run (Ignored if |
clrp |
Character value. The color palette of choice.
Run (Ignored if |
clrp.adjust |
Named character vector or NULL. If character, it adjusts the colors that are used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group. |
color.trans |
Character value. If the variable displayed by color is continuous (numeric)
|
... |
Additional arguments given to the respective function.
|
If the specified clrp
does not contain enough colors to cover the
specified variable NULL is returned - which makes the call to ggplot2::ggplot()
use the default ggplot2 color panel.
An unnamed list containing the ggproto object.
library(ggplot2)
ggplot(mtcars, aes(x = qsec, y = wt)) +
geom_point(aes(color = mpg)) +
scale_color_add_on(aes = "color", clrsp = "Reds 3")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.