## plot six plots
auto.layout(6)
for (i in 1:6){
plot(rnorm(100), rnorm(100))
}
## same as mar(mfrow=c(3,2))
par(mfrow=c(3,2))
for (i in 1:6){
plot(rnorm(100), rnorm(100))
}
## default for odd number of plots using mfrow looks terrible
par(mfrow=c(3,2))
for (i in 1:5){
plot(rnorm(100), rnorm(100))
}
## much better with auto.layout
auto.layout(5)
for (i in 1:5){
plot(rnorm(100), rnorm(100))
}
Run the code above in your browser using DataLab