Skip to content
Prev 257298 / 398506 Next

multiple lines on multiple plots

Going back to a previous graph does not automatically restore the coordinate system (as you noticed).  But you can store that information (lot less info than your data in most cases) and reset it manually.  Try:

x<- 1:10
y<- (1:100)*3
par(mfcol=c(2,1))
plot(x)
tmp1 <- par('usr')
plot(y)
tmp2 <- par('usr')

par(mfg=c(1,1))
par(usr=tmp1)
lines(x)
par(mfg=c(2,1))
par(usr=tmp2)
lines(y)