[R] arrows and points for error bars

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Oct 20 13:51:14 CEST 2006


"Simon Pickett" <S.Pickett at exeter.ac.uk> writes:

> Hello everyone,
> I have successfully made an error bar graph using the points() command
> with the arrows() command to maually add on the standard errors.
> 
> However, one slightly annoying feature of using this method is that the
> points dont line up exactly with the arrows (if you look carefully the
> points are never perfectly in the centre of the arrow), even when you move
> the arrows around in an attempt to correct this.

Is this a pixelization issue? If the line is an odd number of pixels
wide and the point is an even number of pixels across, then there is
just no way to line them up. It should go away with increased
resolution, e.g. when plotting to pdf() and printing on a laser
printer. 
 
> Secondly I cant seem to force the points to appear on top of the arrows
> i.e. with the arrows behind the points. Uing ADD=TRUE to either command
> wont work.

Plot the points last and use a filled symbol, or pch %in% 21:25 with
bg="white". (example(points) is generally helpful in these matters)

> Does anyone have any solutions to this problem, or maybe even a different
> way of making error plots?
> 
> Sorry if this seems a bit pedantic, but it would be great if I could
> resolve this problem and so enable me to use R for publication standard
> graphs...
> 
> Thanks everyone :-)



-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list