Re: [R] split a y-axis to show data on different scales

From: John Kane <>
Date: Mon 14 Aug 2006 - 07:31:25 EST

> Hello,
> How do I split a y-axis to plot data on different
> scales?
> Eg:
> x <- 1:10
> y <-
> 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))

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. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon Aug 14 07:34:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 14 Aug 2006 - 08:18:34 EST.

Mailing list information is available at Please read the posting guide before posting to the list.