The key is to not change the margins, set them once and stick with those margins. The next question then becomes "how do I leave area at the top/bottom for the title and common axis?" to which the answer is "Set outer margins at the beginning".
Modifying your code: y<-rnorm(1:100) x<-rnorm(1:100) par(mfrow=c(6,1), mar=c(0,5,0,5), oma=c(4,0,2,0)) plot(y~x, xlab="", xaxt="n", ylab="y") plot(y~x, xlab="", xaxt="n", ylab="y") plot(y~x, xlab="", xaxt="n", ylab="y") plot(y~x, xlab="", xaxt="n", ylab="y") plot(y~x, xlab="", xaxt="n", ylab="y") plot(y~x, xlab="x", ylab="y") On Mon, Nov 19, 2012 at 8:51 AM, Richard James <richard.j.coo...@uea.ac.uk>wrote: > Dear colleagues, > > I wish to create a figure with 6 plots arranged vertically with no spacing > between them as they all have a common x-axis. > > However, using the code below I'm unable to get the plot area the same size > for each plot. > > The bottom plot with the x-axis label is smaller than the others, as is the > top plot which has larger margins. > > How can I get the plot region the same size for all 6 plots, whislt still > having a large enough margin for the x-axis label on the bottom plot? > > y<-rnorm(1:100) > x<-rnorm(1:100) > par(mfrow=c(6,1)) > par(mar=c(0,5,2,5)) > plot(y~x, xlab="", xaxt="n", ylab="y") > par(mar=c(0,5,0,5)) > plot(y~x, xlab="", xaxt="n", ylab="y") > plot(y~x, xlab="", xaxt="n", ylab="y") > plot(y~x, xlab="", xaxt="n", ylab="y") > plot(y~x, xlab="", xaxt="n", ylab="y") > par(mar=c(4,5,0,5)) > plot(y~x, xlab="x", ylab="y") > > Regards > > Richard > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Plot-Area-Dimensions-tp4650051.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.