[R] stair-step plot

Duncan Murdoch murdoch.duncan at gmail.com
Fri Oct 21 16:25:17 CEST 2011


On 21/10/2011 6:39 AM, knut-o wrote:
> Hello
> Is it possible to map a plot with horizontal lines like in the step-plot,
> but without the vertical lines?


Not in the basic plot function, but you can write your own fairly 
easily, using segments().  For example:

x <- y <- 1:10
plot(x,y, type='n')
segments(x[-10], y[-10], x[-1], y[-10])

Duncan Murdoch



More information about the R-help mailing list