twogrp<-c(rnorm(10)+4,rnorm(10)+20)
gap.plot(twogrp,gap=c(8,16),xlab="Index",ylab="Group values",
main="Plot gap on Y axis")
if(dev.interactive()) par(ask=TRUE)
gap.plot(twogrp,rnorm(20),gap=c(8,16),gap.side="x",xlab="X values",
xtics=c(4,7,17,20),ylab="Y values",main="Plot gap on X axis")
par(ask=FALSE)
Run the code above in your browser using DataLab