grattan_scale: Convenient functions to set Grattan-appropriate palettes

grattan_scaleR Documentation

Convenient functions to set Grattan-appropriate palettes

Description

Convenient functions to set Grattan-appropriate palettes

Usage

grattan_colour_manual(
  n = 0,
  reverse = FALSE,
  discrete = TRUE,
  faded_level = 0,
  faded = FALSE,
  palette = "full",
  ...
)

grattan_fill_manual(
  n = 0,
  reverse = FALSE,
  discrete = TRUE,
  faded_level = 0,
  faded = FALSE,
  palette = "full",
  ...
)

Arguments

n

Numeric. The number of levels in your colour scale. Minimum value is 1, maximum is 7. Passed to grattan_pal; see ?grattan_pal for more information.

reverse

Logical. FALSE by default. Setting to TRUE reverses the standard colour order.

discrete

Logical. TRUE by default. Setting to FALSE generates a continuous colour scale.

faded_level

Integer between 0 (no fade; the default) and 8 (most faded).

faded

Deprecated - use faded_level. Logical. FALSE by default. Setting to TRUE returns the faded variations of the standard colours. If TRUE and faded_level = 0, sets faded_level to 5.

palette

Sets the colours that will form the continuous palette when discrete = FALSE. One of:

  • "full"The default. Red, dark orange, light orange, yellow, light yellow

  • "full_f" faded version of "full"

  • "light" light orange, yellow, light yellow

  • "dark" red, dark orange, light orange

  • "diverging" red, faded red, white, faded light orange, light orange

  • "grey" grey 1, grey 2, grey 3, grey 4, grey 5

...

arguments passed to ggplot2 scales

Examples


library(ggplot2)

ggplot(data = mtcars, aes(x = wt, y = mpg, col = factor(cyl))) +
   geom_point() +
   grattan_colour_manual(n = 3) +
   theme_grattan()


MattCowgill/grattantheme documentation built on Jan. 13, 2023, 11:02 a.m.