scrgb {ggplot} | R Documentation |
Scale continuous variables to red, green and blue components of colour.
scrgb(plot = .PLOT, name="", to=list())
plot |
plot to add scale to |
name |
name of the scale (used in the legend) |
to |
named list of target ranges (r.to, g.to, b.to, a.to) |
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.
Note: alpha mappings only work with the Quartz and PDF devices.
Hadley Wickham <h.wickham@gmail.com>
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))