scale_color_pancan: Color scale creator to add gnomeR colors in ggplot

Description Usage Arguments Examples

View source: R/gnomer_color_palette.R

Description

This color scale generator will interpolate between colors, even when discrete scales are provided. To use exact discrete colors, see examples in gnomer_palette

Usage

1
2
scale_color_pancan(palette = "main", discrete = TRUE,
  reverse = FALSE, ...)

Arguments

palette

Character name of palette in msk_palettes, supplied in quotes. Options include "main" (default), "pancan", "sunset".

discrete

Boolean indicating whether color aesthetic is discrete. Default is TRUE.

reverse

Boolean indicating whether the palette should be reversed. Default is FALSE.

...

Additional arguments passed to discrete_scale() or scale_color_gradientn(), used respectively when discrete is TRUE or FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(ggplot2)

# use a discrete color scale
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point(size = 4) +
scale_color_pancan("pancan")

# use a continuous color scale
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Sepal.Length)) +
geom_point(size = 4, alpha = .6) +
scale_color_pancan(palette = "sunset", discrete = FALSE)

margarethannum/gnomeR documentation built on Feb. 26, 2020, 8:16 p.m.