Skip to content

Plotting error bars in xy-direction

2 messages · Hans W Borchers, Ben Bolker

#
Dear R-help,

I am looking for a function that will plot error bars in x- or y-direction (or 
both), the same as the Gnuplot function 'plot' can achieve with:

    plot "file.dat" with xyerrorbars,...

Rsite-searching led me to the functions 'errbar' and 'plotCI' in the Hmisc, 
gregmisc, and plotrix packages. As I understand the descriptions and examples, 
none of these functions provides horizontal error bars.

Looking into 'errbar' and using segments, I wrote a small function for myself 
adding these kinds of error bars to existing plots. I would still be interested 
to know what the standard R solution is.

Regards,  Hans Werner
#
Hans W Borchers wrote:
plotCI from plotrix will do horizontal error bars --
from ?plotCI:

  err: The direction of error bars: "x" for horizontal, "y" for
          vertical ("xy" would be nice but is not implemented yet;
          don't know quite how everything would be specified.  See
          examples for composing a plot with simultaneous horizontal
          and vertical error bars)

  Ben Bolker