Skip to contents

A gradient with two poles around a neutral color. The neutral color always lands on midpoint, however lopsided the data.

Usage

scale_fill_maison_div(
  palette = "diverging",
  midpoint = 0,
  reverse = FALSE,
  ...
)

scale_colour_maison_div(
  palette = "diverging",
  midpoint = 0,
  reverse = FALSE,
  ...
)

scale_color_maison_div(
  palette = "diverging",
  midpoint = 0,
  reverse = FALSE,
  ...
)

Arguments

palette

"diverging", "diverging_green" or "quiet".

midpoint

The data value drawn in the neutral color.

reverse

TRUE swaps the poles.

...

Passed to ggplot2::scale_fill_gradientn() or ggplot2::scale_colour_gradientn().

Value

A ggplot2 scale.

Details

PalettePolesUse
"diverging"charcoal and red, around warm_whitethe default
"diverging_green"plum and greenwhen the high end is good news
"quiet"muted purple and muted sage, around a light grayno good or bad direction, such as "prefer A" against "prefer B"

Examples

library(ggplot2)
df <- expand.grid(x = 1:6, y = 1:4)
df$change <- seq(-10, 30, length.out = nrow(df))
ggplot(df, aes(x, y, fill = change)) +
  geom_tile() +
  scale_fill_maison_div("diverging_green") +
  theme_maison(base_family = "sans", grid = "")