scrgb: Scale: colour (rgb) Scale continuous variables to red, green...

View source: R/scale-cont-colour.r

scrgbR Documentation

Scale: colour (rgb) Scale continuous variables to red, green and blue components of colour.

Description

The RGB colour space is NOT perceptually uniform. Use this scale with care. It is extremely ill-advised to map variables to more than one of r, g, b, or a.

Usage

scrgb(plot, name = "", to = list())

scfillrgb(plot, name = "", to = list())

Arguments

plot

plot

name

namen of the scale (used in the legend)

to

named list of target ranges (r.to, g.to, b.to, a.to)

Details

Note: alpha mappings only work with the Quartz and PDF devices.

Examples

library(ggplot2movies)
p <- scrgb(ggplot(movies, aes=list(y=rating, x=year)))
ggpoint(p, list(r=year))
ggpoint(p, list(b=rating))
ggpoint(p, list(b=rating, r=1))
scrgb(ggpoint(p, list(b=rating, r=1)), list(b.to=c(0.25,0.75)))
ggpoint(p, list(b=rating, r=year))
ggpoint(p, list(b=rating, r=year, g=year))

hadley/ggplot1 documentation built on Dec. 1, 2024, 11:23 a.m.