Skip to Content

ggplot2 labels for color=factor(foo)

Having a hard time with labels on a ggplot2 plot. Here's a similar plot from the examples page:

mt <- ggplot(mtcars, aes(mpg, wt, colour = factor(cyl))) + geom_point() 
mt + facet_grid(. ~ cyl, scales = "free")

How would I define a list of labels for factor(cyl)?