[R] ggplot2: using more than 6 symbols

Dave Murray-Rust d.murray-rust at ed.ac.uk
Mon Nov 17 13:35:43 CET 2008


I'm trying to plot multiple lines using different colours/symbols to  
distinguish them. If I try to plot more than 6 lines, I get an error:

 > ggplot( dat, aes(x=time,y=value,group=variable,shape=variable) ) +  
geom_line()
Error: scale_shape can deal with a maximum of 6 discrete values, but  
you have 9.  See ?scale_manual for a possible alternative

I find this slightly confusing, as there are ~25 symbols listed for  
use. (I'm using ggplot2 0.7, on OSX, R 2.7.2)

Ideally, I'd like to use a combination of colours and symbols (e.g. 5  
colours and 4 symbols -> 20 unique possibilities) or even colours,  
symbols and linetypes - is there a way to do this in ggplot2?

Cheers,
dave

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the R-help mailing list