[R] drawing segments through points with pch=1

Jim Lemon jim at bitwrit.com.au
Mon Jul 21 11:12:09 CEST 2008


     A. On Sun, 2008-07-20 at 15:40 +0100, David Epstein wrote:
> What I don't like about type="b", also suggested by Paul Smith, is  
> that the segments do not go right up to the little circles---a gap is  
> left, which I don't like. So far, Uwes' solution is what suits me  
> best. However, I understand Brian's objection, though it doesn't  
> apply in my case. The discussion makes me fear that it's a very long  
> road ahead before I can get fine control of R graphics.

Hi David,
If you want to get transparency in the middle of the points and lines
that connect them, try this:

pointgap<-strwidth("o")/2
segments(x[1:ll-1]+pointgap,ybar,x[2:ll]-pointgap,ybar)

Jim



More information about the R-help mailing list