Learn R Programming

ggplot2 (version 0.9.1)

scale_linetype: Scale for line patterns.

Description

Default line types based on a set supplied by Richard Pearson, University of Manchester. Line types can not be mapped to continuous values.

Usage

scale_linetype(...)

scale_linetype_continuous(...)

scale_linetype_discrete(...)

Arguments

...
common discrete scale parameters: name, breaks, labels, na.value, limits and guide. See discrete_scale for more de

Examples

Run this code
library(reshape2) # for melt
library(plyr) # for ddply
ecm <- melt(economics, id = "date")
rescale01 <- function(x) (x - min(x)) / diff(range(x))
ecm <- ddply(ecm, "variable", transform, value = rescale01(value))

qplot(date, value, data=ecm, geom="line", group=variable)
qplot(date, value, data=ecm, geom="line", linetype=variable)
qplot(date, value, data=ecm, geom="line", colour=variable)

# See scale_manual for more flexibility

Run the code above in your browser using DataLab