scrgb {ggplot} | R Documentation

## Scale: colour (rgb)

### Description

Scale continuous variables to red, green and blue components of colour.

### Usage

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

### Arguments

`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)

### Details

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.

### Author(s)

Hadley Wickham <h.wickham@gmail.com>

### See Also

`map_colour_rgb`, `rgb`

### Examples

    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))

[Package ggplot version 0.4.2 Index]