Create sequential, diverging, and categorical color scales using official ADL colors.
Usage
scale_adl(
type = "categorical",
palette = "base",
aesthetic = c("fill", "color"),
n,
direction = "original",
legend_order = "original",
legend_title = NULL,
wrap_legend_labels = NULL,
...
)
Arguments
- type
A character string indicating the type of color palette. There are two options:
Categorical is used for both diverging and discrete palettes.
Sequential is used for sequential palettes.
- palette
A character string indicating the name of the palette (e.g., "likert_6"). For more info and to see all the different color palettes available, check out
adl_palettes
.- aesthetic
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
andfill
aesthetics at the same time, viaaesthetic = c("colour", "fill")
- n
The number of colors.
- direction
A character string indicating if the order of the colors should be reversed. There are two values:
"original" keep the original order of colors
"reverse" flips the order of colors
- legend_order
A character string indicating if the order of the colors and labels in the legend should be reversed. Currently there are two options:
"original" keeps the original order of the legend
"reverse" flips the order of the legend
- legend_title
A character string indicating what the title of the legend should be. There are three options for this:
legend_title
is left blank. If this happens the title of the scale is taken from the first mapping used for that aestheticlegend_title = "none"
If this happens then the title is removed from the legendlegend_title = "some string"
If this happens the legend title becomes whatever is in the string (in this case the title would be "some string")
- wrap_legend_labels
Determine number of characters per line in the labels. Uses label_wrap to wrap the text across multiple lines. If left blank, defaults to
NULL
which does not wrap the labels at all.- ...
additional arguments to pass to
scale_fill_manual