Skip to contents

A function to apply the Ophelia colour palettes to ggplots, using interpolation to ensure the right number of colours. It builds upon scale_colour_ophelia(), to ensure the two functions remain aligned in future developments.

Usage

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

Arguments

palette

The Ophelia palette you want to use. Choose from "default", "teal_to_gold", "teal_to_crimson", "cool_colours", "warm_colours", "skip_gold", "neg_to_pos", "us_rep_to_dem" or "divergent"

reverse

Logical. Default is FALSE. Change to TRUE to reverse the palette (e.g. to make "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 "fill". Can be changed to "colour", but it's best to use scale_colour_ophelia() to apply the colour palettes to the colour aesthetic.

.colours

ophelia_colours

.palettes

ophelia_palettes

...

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