Re: [R] Multi-plot figures with different numbers of plots in different rows

From: Anne York <york_at_zipcon.net>
Date: Sun 27 Mar 2005 - 04:20:12 EST

On Sat, 26 Mar 2005, Hess, Stephane wrote:

HS > Dear all, 
HS > 
HS > I have 5 plots that I would like to include in a single figure, spread over two rows. If I use mfrow=c(2,3), and produce my plots one after the other, I will end up with three plots in the first row, and 2 in the second row, which is what I want. However, I would like the two plots in the second row to be moved to the centre of that row, rather than occupying the two left-most cells.
HS > 
HS > I have also considered using split.screen, but this would mean that the plots in the lower half would be wider than in the upper half, whereas I want them all to be of the same size.
HS > 
HS > Thanks in advance for any suggestions on how this can be done.
HS > 
HS > Stephane
HS > 
HS > 
HS > --------------------------------------------------------------------------------------
HS > Mr Stephane Hess
HS > Centre for Transport Studies
HS > Imperial College London
HS > -------------------------------------------------------------------------------------- 


Here is a brute force way:

par(mfrow=c(2,3)) #set up 2 rows x 3 colums

plot(1:10) #plot 1
plot(1:10) #plot 2
plot(1:10) #plot 3
par(mfg=c(2,2))  # start next plot at 2,2 instead of 2,1
 plot(1:10)       # 4th plot

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Mar 27 07:22:40 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST