Skip to content
Back to formatted view

Raw Message

Message-ID: <1350661577095-4646773.post@n4.nabble.com>
Date: 2012-10-19T15:46:17Z
From: autumnlin
Subject: how can i plot dotted regression line shaped with condition using ggplot

I am plotting ggplot smooth line. I would like to add dots to the regression
line, the dots are shaped under different condition. 

p <- ggplot(data, aes(x = x, y = y, 
                                   shape = assign, linetype = factor(sex))) 

p0b <- p+ 
  scale_linetype_manual(breaks=c("0","1"), values=c(1,2)) +
  geom_smooth(aes(shape = assign, linetype = female), method = "lm", se =
FALSE, size = 1.2) 

the dots on the smooth line should be shaped by assign. how can i do it?
maybe i should add something like 
 scale_shape_manual(values=c(17, 0, 19))
and whatelse?
Thanks.



--
View this message in context: http://r.789695.n4.nabble.com/how-can-i-plot-dotted-regression-line-shaped-with-condition-using-ggplot-tp4646773.html
Sent from the R help mailing list archive at Nabble.com.