--- Rashmi Mathur <[EMAIL PROTECTED]> wrote: > Hello, > > How do I split a y-axis to plot data on different > scales? > > Eg: > > x <- 1:10 > y <- > c(-0.01,0.79,0.74,0.55,-0.67,0.32,-0.47,-0.05,723,759) > plot(x,y) > > I'd like to show these data on the same plot, but > the way it's written, all > contrast in the first 8 data points is lost. Can R > split a y-axis for me? > > Thanks, > Rashmi > As Hadley said: Don't. It can lead to misinterpretations. You are better off if you plot two graphs. Consider something like using par(mfrow)and place the two graphs one above the other on the same page. This will let you use a common x-axis but avoids the split problem.
Quick and dirty example: x <- c(1:10) y <- c(1:10) z <- c(21:30) par(mfrow= c(2,1)) plot(x,y) plot(x,z) Have a look at Cleveland's book The Elements of Graphing Data (Revised Edition). W. S. Cleveland (1994). Hobart Press, Summit, New Jersey for some suggestions and the reason a split y-axis is not a good idea. ______________________________________________ [email protected] 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.
