which_pal_scale {esquisse} | R Documentation |
Automatically select appropriate color scale
Description
Automatically select appropriate color scale
Usage
which_pal_scale(
mapping,
palette = "ggplot2",
data = NULL,
fill_type = c("continuous", "discrete"),
color_type = c("continuous", "discrete"),
reverse = FALSE
)
Arguments
mapping |
Aesthetics used in |
palette |
Color palette. |
data |
An optional |
fill_type , color_type |
Scale to use according to the variable used
in |
reverse |
Reverse colors order or not. |
Value
a list
Examples
library(ggplot2)
# Automatic guess according to data
which_pal_scale(
mapping = aes(fill = Sepal.Length),
palette = "ggplot2",
data = iris
)
which_pal_scale(
mapping = aes(fill = Species),
palette = "ggplot2",
data = iris
)
# Explicitly specify type
which_pal_scale(
mapping = aes(color = variable),
palette = "Blues",
color_type = "discrete"
)
# Both scales
which_pal_scale(
mapping = aes(color = var1, fill = var2),
palette = "Blues",
color_type = "discrete",
fill_type = "continuous"
)
[Package esquisse version 2.0.0 Index]