Skip to contents

This is a convenient wrapper around ggplot2::scale_color_gradientn() and openair::openColours() which creates colour gradients for ggopenair plots, with helpful defaults.

Usage

scale_opencolours_c(
  colours = "default",
  na_value = "grey50",
  aes = c("colour", "fill"),
  ...
)

Arguments

colours

The openair colour scheme to use. See openair::openColours() for more information.

na_value

The aesthetic value to use for missing (NA) values. Defaults to "grey50".

aes

Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. The default, c("colour", "fill"), applies colours to both the colour and fill aesthetics.

...

Other arguments to pass to ggplot2::scale_color_gradientn().

Value

A ggproto object defining a continuous colour scale for use with ggplot2::ggplot().

Examples

if (FALSE) {
polar_plot(mydata, "nox") + scale_opencolours()
}