Skip to content
Prev 155928 / 398513 Next

Scatterplot with data grouped by color

On Fri, Sep 12, 2008 at 5:29 PM, Amanda Young <amandag at mit.edu> wrote:
install.packages("ggplot2")
library(ggplot2)

qplot(A, B, data = dataframe, color = C)

That will also automatically draw a legend for you.  See
http://had.co.nz/ggplot2 for more info.

Hadley