These functions provide the option to use the discrete and dynamic palettes
along with the ggplot2
package. It goes without saying that it requires
ggplot2
to work.
scale_colour_paletteer_d(package, palette, direction = 1,
dynamic = FALSE, ...)scale_color_paletteer_d(package, palette, direction = 1,
dynamic = FALSE, ...)
scale_fill_paletteer_d(package, palette, direction = 1,
dynamic = FALSE, ...)
Name of package from which the palette is desired as string or symbol.
Name of palette as string or symbol.
Either 1
or -1
. If -1
the palette will be reversed.
toggles between the discrete palettes and the dynamic palettes. Defaults to FALSE which indicates discrete palettes.
additional arguments to pass to discrete_scale
Available package/palette combinations are available in the data.frame
palettes_d_names
and
palettes_dynamic_names
. Both package
and
palette
can be supplied as symbols or strings.
# NOT RUN {
if (require('ggplot2')) {
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) +
geom_point() +
scale_colour_paletteer_d(package = "nord", palette = "frost")
}
# }
Run the code above in your browser using DataLab