On 10/07/2009 07:12 PM, ogbos okike wrote:
Good morning. I wish to plot two data on the same axis. I tried plot(x,y, type = "l") for the first and tried to use lines or points(x,y, lty = 2, col = 4) to add or plot the second data on alongside the first. However, what I got was not encouraging. I have attached the two data and would be pleased if anybody could be of help.
Hi Ogbos, Try this:
plot(oo1$daymon,oo1[,4], main="Two years of something",type="l",col="blue", ylim=c(3300,4400)) lines(oo2$daymon,oo2[,4],col="red") legend(oo1$daymon[100],3600,c("2005","2006"), col=c(4,2),lty=1) Jim ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.