Re: [R] how to draw a vertical line from points to x-axis

2008-09-08 Thread Adam D. I. Kramer
I think you want the ?lines function. To connect a point (x,y) to the x-axis, lines(x=c(x,x),y=c(y,0)) ...draws a line from that point to the x-axis. You may also want to specify pch=c(?,""),type="b" where ? is the original point type (which you don't want to "run over") and "" is the pch for t

Re: [R] how to draw a vertical line from points to x-axis

2008-09-08 Thread Nair, Murlidharan T
[R] how to draw a vertical line from points to x-axis Anny Here's one way: plot(0:10, 0:10, pch=16) lines(rep(0:10, each=3), t(matrix(c(0:10, rep(c(0,NA), each=11)), ncol=3))) HTH Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]

Re: [R] how to draw a vertical line from points to x-axis

2008-09-07 Thread Barry Rowlingson
2008/9/7 Anny Huang <[EMAIL PROTECTED]>: > Hello, > > I want to know how to draw a line connecting each point to the x-axis > perpendicularly (i.e. a vertical line). > abline(v=...) seems not to work for my purpose, because it runs over the > data point. Can anyone help? Thanks. > If your x-axis

Re: [R] how to draw a vertical line from points to x-axis

2008-09-07 Thread Peter Alspach
Anny Here's one way: plot(0:10, 0:10, pch=16) lines(rep(0:10, each=3), t(matrix(c(0:10, rep(c(0,NA), each=11)), ncol=3))) HTH Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Anny Huang > Sent: Monday, 8 September 2008 8:49 a