Skip to content

how can i plot dotted regression line shaped with condition using ggplot

4 messages · autumnlin, Ista Zahn

#
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.
#
I may be missing something, but if you want dots you need to ask for
them with geom_point()

Best,
Ista
On Fri, Oct 19, 2012 at 11:46 AM, autumnlin <jialincau at gmail.com> wrote:
#
See

?annotate

for help on adding individual points/labels/etc to a plot.

Best,
Ista
On Fri, Oct 19, 2012 at 3:48 PM, autumnlin <jialincau at gmail.com> wrote: