Learn R Programming

LaCroixColoR (version 0.1.0)

scale_color_lacroix: LaCroix color scales

Description

Create color scales using LaCroix palettes. Currently only works with the flavor-specific palettes (not the "paired" palette).

Usage

scale_color_lacroix(name, discrete = FALSE, ...)

scale_colour_lacroix(name, discrete = FALSE, ...)

scale_fill_lacroix(name, discrete = FALSE, ...)

Arguments

name

Name of color palette (LaCroix flavor) desired.

discrete

Generate a discrete palette? Defaults to FALSE, aka continuous mapping.

...

parameters passed on to discrete_scale (discrete mapping) or scale_color_gradientn (continuous mapping).

Value

A Scale object.

Details

Implementation heavily inspired by the package.

Examples

Run this code
# NOT RUN {
library(ggplot2)

# ggplot2 examples, but with more seltzer
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(size=4, aes(color = factor(cyl))) +
    scale_color_lacroix("PassionFruit", discrete = TRUE) +
    theme_bw()

p + geom_point(size=4, aes(color = hp)) +
    scale_color_lacroix("PassionFruit", discrete = FALSE) +
    theme_bw()

# }

Run the code above in your browser using DataLab