scgradient {ggplot} | R Documentation

## Scale: colour gradient

### Description

Scale a continuous variable along a colour gradient.

### Usage

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

### Arguments

`plot` | plot object to add scale to
`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.2.2 Index]