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

From: Jim Lemon <>
Date: Tue 15 Aug 2006 - 09:46:50 EST

Rashmi Mathur 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?
Hi Rashmi,

Although Hadley's answer is relevant (displaying vastly different ranges of data can be dangerous) you might find that gap.plot in the plotrix package will do the dirty deed.

Jim mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon Aug 14 19:50:18 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 Tue 15 Aug 2006 - 04:22:18 EST.

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