make_grattan_pal: Interpolate a grattan colour palette

View source: R/grattan_pal.R

make_grattan_palR Documentation

Interpolate a grattan colour palette

Description

This function takes a grattan colour palette and generates more colours from it, so that there are enough to make your chart.

Usage

make_grattan_pal(palette = "sequential", reverse = FALSE, ...)

Arguments

palette

(character; default = "graph") given name of a grattan palette: grattan_palettes

reverse

(boolean; default = FALSE) indicating if palette should be reverse

...

Additional arguments to pass to colorRampPalette see details here colorRamp

Details

The interpolation method is set to "spline" (the default is "linear") in an attempt to reduce the number of vomit colours that get produced when generating many colours.

It returns a function that takes a single value and makes that many colours.

See Also

grattan_palettes

Examples


ggplot2::ggplot(mtcars, ggplot2::aes(x = mpg, y = hp, colour = as.character(wt))) +
  ggplot2::geom_point() +
  ggplot2::scale_colour_manual(values = make_grattan_pal()(29))


grattan/grattantheme documentation built on June 28, 2023, 1:50 p.m.