[R] plot xy data with error bars

Petr Pikal petr.pikal at precheza.cz
Thu May 25 08:30:17 CEST 2006


Hi


On 25 May 2006 at 1:08, Tibi Codilean wrote:

Date sent:      	Thu, 25 May 2006 01:08:20 +0100
From:           	"Tibi Codilean" <Tibi.Codilean at ges.gla.ac.uk>
To:             	r-help at stat.math.ethz.ch
Subject:        	[R] plot xy data with error bars

> Dear All,  
> 
> I have x,y data with errors associated with both x and y. What would
> be the easiest way of creating plots with both x and y error bars?  

I know there is some function(s) in some package(s) for error bar
plotting but if you want to use your own, use arrows

A<-data.frame(x=1:10, y=1:10, erx=rnorm(10)^2, ery=rnorm(10)^2)
plot(x,y)
arrows(x,y,x+erx/10,y, angle=90, length=.1)
arrows(x,y,x-erx/10,y, angle=90, length=.1)
arrows(x,y,x,y-ery/10, angle=90, length=.1)
arrows(x,y,x,y+ery/10, angle=90, length=.1)

HTH
Petr


>

> 
> Thanks
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list