Learn R Programming

crayons (version 0.0.3)

scale_color_crayons: Crayon Color Scales for ggplot2

Description

Crayon Color Scales for ggplot2

Usage

scale_color_crayons(palette = "standard16", which = NULL, ..., reverse = FALSE)

scale_fill_crayons(palette = "standard16", which = NULL, ..., reverse = FALSE)

scale_colour_crayons( palette = "standard16", which = NULL, ..., reverse = FALSE )

Value

A ggplot2::Scale

Arguments

palette

palette from names(crayons) to use

which

numeric indices of colors to use. NULL by default.

...

arguments passed on to ggplot2::discrete_scale()

reverse

Should the vector be reversed? Default is FALSE.

Examples

Run this code
library(ggplot2)
ggplot2::mpg |>
  ggplot() +
   geom_point(aes(displ, hwy, colour = class)) +
   scale_color_crayons(palette = 'original')

ggplot2::mpg |>
  ggplot() +
   geom_point(aes(displ, hwy, fill = class), pch = 23, color = 'transparent') +
   scale_fill_crayons(palette = 'original')

Run the code above in your browser using DataLab