[R] Plot Area Dimensions

Richard James Richard.J.Cooper at uea.ac.uk
Mon Nov 19 16:51:05 CET 2012


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.



More information about the R-help mailing list