Skip to contents

A custom discrete colour and fill scales with colours from 2DII palette.

Usage

scale_colour_r2dii(colour_labels = NULL, ...)

scale_fill_r2dii(colour_labels = NULL, ...)

Arguments

colour_labels

A character vector. Specifies colour labels to use and their order. Run unique(r2dii.plot:::palette_colours$label) to see available colours. Similar to value parameter in ggplot2::scale_colour_manual().

...

Other parameters passed on to ggplot2::discrete_scale().

Value

An object of class "ScaleDiscrete".

See also

Examples

library(ggplot2, warn.conflicts = FALSE)

ggplot(mpg) +
  geom_point(aes(displ, hwy, color = class)) +
  scale_colour_r2dii()


ggplot(mpg) +
  geom_histogram(aes(cyl, fill = class), position = "dodge", bins = 5) +
  scale_fill_r2dii()