Re: [R] ggplot legend for multiple time series

2009-12-01 Thread hadley wickham
Because of the combinatorial nature of ggplot2, it is simply not possible to provide an example that illustrates every single combination of options. There are already over 600 example graphics in the package - if you can't find one that exactly meets your need, you need to buy the book and learn

Re: [R] ggplot legend for multiple time series

2009-12-01 Thread Edwin Sun
Hello - Thank you so much for the help. It works perfectly. I guess that as many have pointed out, ggplot is a great package but there is a lack of documentation and examples. Edwin Sun baptiste auguie-5 wrote: > > Hi, > > I don't understand why you used scale_manual_colour if you want only

Re: [R] ggplot legend for multiple time series

2009-12-01 Thread baptiste auguie
Hi, I don't understand why you used scale_manual_colour if you want only black lines. To have different line types in the legend you can map the linetype to the data, huron <- data.frame(year=1875:1972, level=LakeHuron) ggplot(huron, aes(year)) + geom_line(aes(y=level+5, linetype="above")) +

[R] ggplot legend for multiple time series

2009-12-01 Thread Edwin Sun
Hello All, I am trying to create a legend for a black-white graph. The package I use is ggplot2. It can add colors to the legend key but not line types. Can you please help? # example from Wickman (2009, ggplot2 – elegant graphics for data analysis, page 109) library(ggplot2) huron <- data.fram

[R] ggplot legend for multiple time series

2009-12-01 Thread Changyou Sun
Hello All, I am trying to create a legend for a black-white graph. The package I use is ggplot2. It can add colors to the legend key but not line types. Can you please help? # example from Wickman (2009, ggplot2 - elegant graphics for data analysis, page 109) library(ggplot2) huron <-