scale_manual {ggplot2}R Documentation

scale_manual

Description

Create your own discrete scale

Usage

scale_colour_manual(name=NULL, values=NULL, limits=NULL, breaks=NULL, labels=NULL, formatter=identity, ...)
scale_fill_manual(name=NULL, values=NULL, limits=NULL, breaks=NULL, labels=NULL, formatter=identity, ...)
scale_size_manual(name=NULL, values=NULL, limits=NULL, breaks=NULL, labels=NULL, formatter=identity, ...)
scale_shape_manual(name=NULL, values=NULL, limits=NULL, breaks=NULL, labels=NULL, formatter=identity, ...)
scale_linetype_manual(name=NULL, values=NULL, limits=NULL, breaks=NULL, labels=NULL, formatter=identity, ...)

Arguments

name name of scale to appear in legend or on axis. Maybe be an expression: see ?plotmath
values NULL
limits numeric vector of length 2, giving the extent of the scale
breaks numeric vector indicating where breaks should lie
labels character vector giving labels associated with breaks
formatter NULL
... ignored

Details

This page describes scale_manual, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## Not run: 
p <- qplot(mpg, wt, data=mtcars, colour=factor(cyl))

p + scale_colour_manual(values = c("red","blue", "green"))
p + scale_colour_manual(values = c("8" = "red","4" = "blue","6" = "green"))
## End(Not run)

[Package ggplot2 version 0.8.2 Index]