View source: R/scale-cont-colour.r
scrgb | R Documentation |
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.
scrgb(plot, name = "", to = list())
scfillrgb(plot, name = "", to = list())
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) |
Note: alpha mappings only work with the Quartz and PDF devices.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.