[R] Changing default order of plots in par

Rui Barradas ruipbarradas at sapo.pt
Sat Mar 9 22:22:22 CET 2013


Hello,

Instead of mfrow use mfcol and the order becomes col by col.

Hope this helps,

Rui Barradas

Em 09-03-2013 20:55, Brian Smith escreveu:
> Hi,
>
> I wanted to change the order of how the plots appear in a multiplot
> scenario. For example, in the code below:
>
> #####
>
> pdf('test.pdf',width=8,height=8)
> par(mfrow = c(2,2))
>
> for(i in 1:2){
>    v1 <- sample(1:1000,50)
>    v2 <- sample(1:1000,50)
>    mat <- cbind(v1,v2)
>
>    plot(v1,v2)
>    boxplot(mat)
>
> }
> dev.off()
>
> #######
>
> The plot ordering is that the first row gets filled in first, then the
> second row etc. But how can I change it so that in the code above, I get
> both the plots in the first row and the both the boxplots in the second row?
>
> many thanks!
>
> 	[[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