Skip to contents

A signed quantity, where the neutral step means no difference. Set limits symmetrically, or the neutral step lands wherever the data straddles.

Usage

scale_colour_mariner_div(reverse = FALSE, ...)

scale_color_mariner_div(reverse = FALSE, ...)

scale_fill_mariner_div(reverse = FALSE, ...)

Arguments

reverse

Logical; if TRUE, reverse the gradient.

...

Further arguments for ggplot2::scale_colour_gradientn() or ggplot2::scale_fill_gradientn().

Value

A ggplot2 diverging scale object.

Examples

library(ggplot2)
mpg$delta <- mpg$hwy - mean(mpg$hwy)
lim <- max(abs(mpg$delta))
ggplot(mpg, aes(displ, hwy, colour = delta)) +
  geom_point() +
  scale_colour_mariner_div(limits = c(-lim, lim))