Skip to content

vertical lines in R plot

5 messages · Naser Jamil, PIKAL Petr, Sarah Goslee +1 more

#
Hi

?segments
segments(x0=c(5.0,5.5,6), y0=c(0,0,0), y1=c(0.12,0.60,0.20))

Regards
Petr
#
Like this:

segments(x0=c(5.0,5.5,6), y0=c(0,0,0), x1=c(5.0,5.5,6), y1=c(0.12,0.60,0.20))

If you wanted them to extend the entire height of the plot,
abline(v=c(5.0,5.5,6))
is simpler.

Thanks for the reproducible example,
Sarah
On Mon, Mar 11, 2013 at 10:10 AM, Naser Jamil <jamilnaser79 at gmail.com> wrote:

  
    
#
Also, type="h", in plot(), points(), or lines() draws vertical line segments between (x,y)
and (x,0).  E.g.,
     points(x=c(5.0,5.5,6), y=c(0.12,0.60,0.20), type="h")
does the same as
   segments(x0=c(5.0,5.5,6), y0=c(0,0,0), x1=c(5.0,5.5,6), y1=c(0.12,0.60,0.20))

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com