Skip to contents

Convenience wrapper to ggplot2::continuous_scale to allow use of idpalette or any arbitrary set of colours to be used as a ggplot2 fill or colour scale

Usage

scale_id_continuous(
  cols,
  aesthetics = c("fill", "colour"),
  na.value = "transparent",
  guide = "colourbar"
)

Arguments

cols

character. A vector of colours

aesthetics

Scale aesthetic.

na.value

Garn - whaddaya want in the NAs?

guide

A function used to create a guide or its name. See ggplot2::guides() for more information

Value

A ggproto object of class Scale and ScaleContinuous

Examples


library(ggplot2)

ggplot(mtcars) +
  geom_point(
    aes(
      x = disp,
      y = hp,
      colour = qsec
    ),
    size = 5
  ) +
  scale_id_continuous(
    cols = iddu(),
    aesthetics = "colour"
  )