scale_trek: Color and fill scale functions for Star Trek palettes

scale_trekR Documentation

Color and fill scale functions for Star Trek palettes

Description

Scale functions used with ggplot2.

Usage

scale_color_trek(palette = "starfleet", discrete = TRUE, reverse = FALSE, ...)

scale_fill_trek(palette = "starfleet", discrete = TRUE, reverse = FALSE, ...)

Arguments

palette

character, name of Star Trek palette. See trek_pal() for a list of palette names.

discrete

logical, discrete or continuous palette.

reverse

logical, reverse color order.

...

additional arguments passed to ggplot2::discrete_scale() or ⁠ggplot2::scale_*_gradientn()⁠, for discrete or continuous palettes, respectively.

Details

Most palettes should be used as qualitative palettes. See trekpals to see how many colors are in each predefined palette. Use view_trek_pals() to plot all palettes to see which may work best for your purposes.

Examples

library(ggplot2)
d <- diamonds[diamonds$cut >= "Very Good", ]
ggplot(d, aes(carat, stat(count), fill = cut)) +
  geom_density(position = "fill") +
  scale_fill_trek("starfleet")

trekcolors documentation built on Sept. 13, 2024, 1:11 a.m.