Skip to contents

A function to apply the Ophelia colour palettes to ggplots, using interpolation to ensure the right number of colours

Usage

scale_colour_ophelia(
  palette = "default",
  reverse = FALSE,
  continuous = FALSE,
  .aesthetic = "colour",
  .colours = ophelia_colours,
  .palettes = ophelia_palettes,
  ...
)

Arguments

palette

The Ophelia palette you want to use. Choose from "default", "cool_colours", "warm_colours", "neg_to_pos", "greens", or "purples".

reverse

Logical. Default is FALSE. TRUE reverses the palette (e.g. makes "neg_to_pos" start with the positive end rather than the negative end of the colour palette).

continuous

Logical. Default is FALSE. Change to TRUE when applying the colour scale to a continuous variable.

.aesthetic

Default is "colour". Can be changed to "fill", but it's best to use scale_fill_ophelia() to apply the colour palettes to the fill aesthetic.

.colours

Used to access ophelia_colours. Please leave as is.

.palettes

Used to access ophelia_palettes. Please leave as is.

...

Additional arguments to pass to ggplot2::continuous_scale / ggplot2::discrete_scale (e.g. guide, limits, etc.)