[R] superposing a group of x,y-plot points

hadley wickham h.wickham at gmail.com
Sat Apr 19 20:20:43 CEST 2008


On Sat, Apr 19, 2008 at 1:06 PM, Tobias Verbeke
<tobias.verbeke at telenet.be> wrote:
> Anna-Maria Tyrisevä wrote:
>
>  > please, could somebody tell me how can I superpose a group of x,y-plot
>  > points (using different symbols) that belong to a certain class of factor z?
>  > Can't find a solution despite of hours of reading.
>
>  x <- rnorm(30)
>  y <- rnorm(30)
>  f <- factor(sample(LETTERS[1:5], 30, replace = TRUE))

Or with legends as well:

install.packages("ggplot2")
library(ggplot2)

qplot(x, y, colour = f)
qplot(x, y, shape = f)

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list