scgradient {ggplot} | R Documentation

## Scale: colour gradient

### Description

Scale a continuous variable along a colour gradient.

### Usage

    scgradient(plot = .PLOT, name="", low='red', mid='white', high="black", midpoint=0, range=c(NA,NA))

### Arguments

`plot` | plot object to add scale to
`name` | name of the scale (used in the legend)
`low` | colour at low end of scale
`mid` | colour at middle of scale
`high` | colour at top of scale
`midpoint` | definition of midpoint
`range` | range to scale data to

### Details

This scale creates a continuous colour gradient from the low colour to the mid colour to high colour, as defined in the arguments.

### Author(s)

Hadley Wickham <h.wickham@gmail.com>

### See Also

`sccolour`

### Examples

    p <- scgradient(ggplot(movies, aes=list(x=mpaa, y=rating)))
    ggjitter(p, list(colour=rating))
    ggjitter(p, list(colour=length))
    p <- ggjitter(p, list(colour=rating))
    scgradient(p, low="yellow")
    scgradient(p, high="green", midpoint=5)

[Package ggplot version 0.4.2 Index]