[R] grey colored lines and overwriting labels i qqplot2

Sigrid s.stenerud at gmail.com
Tue Jul 19 06:23:29 CEST 2011


Hi
I apologize for not providing reproducible codes more clearly, and I hope
this will be more understandable.
  
I have 14 lines (7 per facet that I would like to add). I will provide you
with six of the lines from the data as that should  enough data to work
with, and also result in less plotting for all of us. These value are from a
previously conducted ancova, so not based on simple linear regression.

Line #    Country	   Treatment    Intercept	Slope
1          Low	         A	         81.47	 47.267
2          Low	         B	         31.809	20.234
3          Low	         C	         69.892	33.717
4          High	         A	         67.024	47.267
5          High	         B	         17.357	20.234
6          High	         C	         105.107	33.717

>From the help that I got here, i was able to make the plot I wanted. 
ggplot(data = test, aes(x = year, y = total, colour = treatment)) + 
         geom_point(aes(shape = treatment)) + 
       facet_wrap(~country) + 
         scale_colour_grey(breaks=c('A','B','C','D','E','F','G'), 
                 labels=c('label A','label B','label C','label D', 
                         'label E','label F','label G')) + 
         scale_shape_manual(breaks=c('A','B','C','D','E','F','G'), 
                 labels=c('label A','label B','label C','label D', 
                         'label E','label F','label G'), 
                 values = c(0, 1, 2, 3, 4, 5, 6)) + 
         scale_y_continuous("number of votes") + 
         scale_x_continuous("Years", breaks=1:4) + 
         theme_bw()+


And I added line #1 and # 4 using the abline command. 

+geom_abline(intercept = 81.47, slope=47.267, colour = "black", size = 0.5,
subset = .(country == 'low'))+ geom_abline(intercept = 67.024, slope=47.267,
colour = " grey", size = 0.5, subset = .(country== 'high'))

How can I make the lines correspond with the descriptions on the right side
of the graph more clearly?

--
View this message in context: http://r.789695.n4.nabble.com/grey-colored-lines-and-overwriting-labels-i-qqplot2-tp3657119p3677248.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list