Skip to content
Prev 70273 / 398506 Next

How to break an axis?

Bo Peng wrote:
maybe something like

matplot(1:10, rep(1,10)%o%c(1,3,4), col=1:3, ylim = c(0,20), type='b')
par(new=T)
matplot(1:10, rep(400,10),axes=F,ann=F, col=4, ylim = c(0,400),type='b')
axis(4)
legend(par('usr')[2], par('usr')[4], bg='white',   xjust=1, c('left 
axis', 'left axis', 'left axis', 'right axis'),col=1:4,
    pch=as.character(1:4))


solves your problem (double y-axis instead of splitting the axis).

joerg