[R] error bar ploting problem with 'arrows' function

Yogesh Tiwari yogesh.mpi at googlemail.com
Tue Jan 29 07:57:18 CET 2008


Hello,

 I used 'arrows' function to plot the error bar but it dosen't work always.
For example:

Similar commands on two different data sets gives first result OK and second
result NOT (attached plot1 is OK and plot2 is NOT). Plots as well as data
file is attached here. Below is the script which I used for arrow ploting.

 Kindly help,  Yogesh

*Script for error bar plot1:*

################

plot(file3$lat,file3$STotwoKm,pch=21,cex=2.5,ylim=c(-4,10),xlim=c(-50,50),xlab=NA,ylab=NA,
col=1, xaxs="i",yaxs="i")

arrows(file3$lat,file3$STotwoKm,file3$lat,file3$STotwoKm+sqrt(file3$var1),
col=1, code=2, angle=90,length=0.1)

arrows(file3$lat,file3$STotwoKm,file3$lat,file3$STotwoKm-sqrt(file3$var1),
col=1, code=2, angle=90,length= 0.1)
####################
 **
**
**
*Script for error bar plot2:*
**
*######################*
**
plot(file3$lat,file3$twoTOfive,pch=22,cex=2.5,ylim=c(-4,10),xlim=c(-50,50),xlab=NA,ylab=NA,
col=2,xaxs="i",yaxs="i")

arrows(file3$lat, file3$var2, file3$lat,file3$twoTOfive+sqrt(file3$var2),
col=2, code=2, angle=90, length=0.1)

arrows(file3$lat, file3$var2, file3$lat,file3$twoTOfive-sqrt(file3$var2),
col=2, code=2, angle=90, length=0.1)
###################



-- 
Yogesh K. Tiwari (Dr.rer.nat),
Scientist,
Indian Institute of Tropical Meteorology,
Homi Bhabha Road,
Pashan,
Pune-411008
INDIA

Phone: 0091-99 2273 9513 (Cell)
         : 0091-20-258 93 600 (O) (Ext.250)
Fax    : 0091-20-258 93 825


More information about the R-help mailing list