sccolour {ggplot} | R Documentation

## Scale: categorical colour

### Description

Create a scale for categorical colours.

### Usage

    sccolour(plot = .PLOT, palette=1)

### Arguments

`plot` | plot to add scale to
`palette` | Color Brewer palette to use, see `brewer.pal` for details. Note that palette type is chosen automatically.

### Details

Continuous variables will automatically be converted to categorical using `chop_auto`. You may want to use `chop` to convert the values yourself for finer control.

This scale is automatically added when you have colour in your list of aesthetics. For finer control, you will need to set the scale yourself. See the example for some ideas.

### Author(s)

Hadley Wickham <h.wickham@gmail.com>

### See Also

`scale_categorical`, `map_colour`

### Examples

    p <- ggplot(movies, aes=list(x=mpaa, y=rating))
    ggjitter(p, list(colour=rating))
    ggjitter(p, list(colour=length))
    ggjitter(p, list(colour=chop(length)))
    ggjitter(p, list(colour=chop(length,3)))
    sccolour(ggjitter(p, list(colour=chop(length,3))), 2)

[Package ggplot version 0.2.2 Index]