Skip to contents

Temple Color and Fill Scales for ggplot2

Usage

scale_colour_temple(
  palette = c("main", "diverging", "sequential"),
  discrete = NULL,
  reverse = FALSE,
  midpoint = 0,
  ...
)

scale_color_temple(
  palette = c("main", "diverging", "sequential"),
  discrete = NULL,
  reverse = FALSE,
  midpoint = 0,
  ...
)

scale_fill_temple(
  palette = c("main", "diverging", "sequential"),
  discrete = NULL,
  reverse = FALSE,
  midpoint = 0,
  ...
)

Arguments

palette

One of "main", "diverging", or "sequential".

discrete

Logical; a discrete scale (default for "main") or a continuous gradient.

reverse

Logical; reverse the color order.

midpoint

For continuous "diverging" scales, the data value mapped to white (default 0).

...

Passed to discrete_scale, scale_colour_gradient2, or scale_colour_gradientn.

Value

A ggplot2 scale.

Examples

library(ggplot2)
ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) +
  geom_point() +
  scale_colour_temple()


ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
  geom_raster() +
  scale_fill_temple("sequential", discrete = FALSE)