Here's some code from Hadley's book that assumes you've created ggplot objects a, b, and c. It puts a in the top row, with b and c in the bottom row.
Created by Pretty R at inside-R.org
- different line style from geo_smooth in different facet_wrap
p1 <- ggplot(ds2, aes(x=visit, y=change))+ geom_point(shape=1,
aes(color=treat), position=position_jitter(width=0.4,height=0))
+ facet_grid(snp~race)+ opts(title = 'rsxxxx')
p1 <- p1 + geom_smooth(data=subset(ds2, race == 'CA'), method='lm',
se=F, color='blue', linetype = ifelse(pValues[pValues$'dbsnprsid'
== 'rsxxxx', 'slope1_p'] < 0.05 ,"longdash", "solid" ))
Created by Pretty R at inside-R.org
- background color in the plotting area
+ theme_grey() - the default theme, with a grey background
+ theme_bw() - a theme with a white background
Created by Pretty R at inside-R.org
No comments:
Post a Comment