Skip to contents

This function returns a ggplot with an Exploristics colour scheme added to it. There are 3 colour palettes to choose from RGB, a darker RGB and Mono.

Usage

exploristics_colour(plot, colour_pal = "Expl_RGB", rev_gradient = FALSE)

Arguments

plot

A ggplot2 figure (S3: gg, ggplot).

colour_pal

The colour palette to use. Can be one of Expl_RGB, Expl_RGB_dark or Expl_Mono. Defaults to Expl_RGB

rev_gradient

Should the reverse gradient of the colour palette be used (only for continuous variables). Defaults to FALSE.

Details

This function sets the colour of the ggplot to a palette matching an Exploristics colour scheme. A gradient of the palette will be applied for continuous variables.

  • Expl_RGB is a palette of 6 colours including blues, reds, green and yellow.

  • Expl_RGB_dark is a palette of darker shades of the 6 colours within Expl_RGB.

  • Expl_Mono is a palette of 6 colours ranging from a dark navy through grey to white.

Examples

library(ggplot2)

## generate a plot with the Exploristics theme
cars_plot <- ggplot(data = mtcars, aes(x = hp, y = mpg, colour = mpg)) +
geom_point(size=2) +
exploristics_theme()

## adding the colour scheme can be written as one line
exploristics_colour(cars_plot, colour_pal="Expl_RGB")



library(magrittr)

## or using a pipe
cars_plot %>%
exploristics_colour(colour_pal="Expl_RGB")