Skip to content
Prev 18124 / 398502 Next

plot question

Hi!

I want to display 2 graphs with different number of data points on the
x-axis. The code below scales them so it seems that testtwo has the
same number of data points as testone. How can I fix that? thanks. 


z<-1:50;
x<-1:100;
plot(x,testone,type="l",xlab="",ylab="",main="",lty=4,axes=FALSE,ylim=c(-1.0,1.0),cex=1);
par(new=TRUE);
plot(z,testtwo,type="l",xlab="",ylab="",main="",lty=1,col="red",axes=FALSE,ylim=c(-1.0,1.0),cex=1);
xlabels<-x*10;
axis(1,1:100,xlabels);
axis(2);
box();