[R] Problems:ticks overlap with each other

yk shiyuankun.debian at gmail.com
Tue Feb 24 13:20:34 CET 2009


I have written the codes below. Unfortunately, the ticks generated by
matplot A and matplot B overlap with each other. Does anyone have some
idea to avoid it automatically?

split_y=2.0e-4
layout(matrix(c(1,2),2,1,byrow=T),height=c(1,3))
par(mar=c(0.5,4.5,1.5,1.5))
x_row=max(row(x_m))
A:matplot(c(0,max_x),c
(split_y,max_y),type="n",xaxt="n",yaxs="i",ylab="",xlab="",main=paste
('channel',channel),)
for (i in 2:5){
points(temp_x[temp_y>split_y],temp_y[temp_y>split_y],col=i)
}
par(mar=c(6.5,4.5,1.0,1.5))
B:matplot(c(0,max_x),c(0,split_y),ylim=c
(0,split_y),type="n",yaxs="i",ylab="Population density",xlab="life time
(fs)",sub="life time distribution from different reactant")
for (i in 2:5){
temp_x=x_m[1:x_row,i-1][x_m[1:x_row,i-1]>0]
temp_y=y_m[1:x_row,i-1][x_m[1:x_row,i-1]>0]
points(temp_x[temp_y<split_y],temp_y[temp_y<split_y],col=i)
}
legend(list(x=max_x*0.7,y=max_y),legend=leg.txt,col=leg.col,pch=1)
}

Both of them generate ticks 2.0e-4, but the 0 overlaped with each
other. It looks ugly.
Thankyou for your attention




More information about the R-help mailing list