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

Jim Lemon jim at bitwrit.com.au
Tue Aug 15 01:46:50 CEST 2006


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



More information about the R-help mailing list