[R] mfrow and centering plots when there's an odd number

R. Michael Weylandt <michael.weylandt@gmail.com> michael.weylandt at gmail.com
Tue Jul 10 01:03:10 CEST 2012


Take a look at ?layout

Michael

On Jul 9, 2012, at 5:15 PM, Dustin Fife <fife.dustin at gmail.com> wrote:

> Let me start with an example:
> 
> par(mfrow=c(2,3))
> for (i in 1:5){
>    x = rnorm(100)
>    y = .5*x + rnorm(100, 0, sqrt(1-.5^2))
>    plot(x,y)
> }
> 
> Note that there's five plots and six spaces for those plots via mfrow,
> leaving one row empty. Is there a way to have the bottom two plots
> centered? I think it looks weird to have them left-justified. Thanks in
> advance for the help!
> 
> -- 
> Dustin Fife
> PhD Student
> Quantitative Psychology
> University of Oklahoma
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list