[R] plot multiple graphs in one graph and in multiple windows

Patrick Connolly p_connolly at slingshot.co.nz
Thu Oct 3 09:52:00 CEST 2013


On Thu, 26-Sep-2013 at 04:47PM +0000, Hui Du wrote:

|> 
|> Hi All,
|> 
|> I have a question about plotting graphs. Supposedly, I want to plot
|> 12 graphs. Putting 12 graphs to one window seems too
|> crowded. Ideally, I want to put 4 pictures in one window and plot
|> them in three separate window. For exmaple, my psuedo code is like

Depends how you use them.  I'd be inclined to make them into a 3 page
PDF file.  However, if you really need to see them simultaneously on
the screen and can see 3 plotting windows on your screen, it would be
easier still to make the plotting window larger and do all 12 in that
window using par(mfrow = c(4, 3)) pr par(mfrow = c(3, 4)).

HTH

|> 
|> par(mfrow = c(2, 2))
|> 
|> for( I in 1:12)
|> {
|> plot(rnorm(100));
|> 
|> if( i %% 4 == 0)
|> #
|> # open a New window with par(mfrow = c(2, 2)):
|> # My question is how to control here? Thank you for your help.
|> #
|> }
|> 
|> HXD
|> 
|> 	[[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.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.



More information about the R-help mailing list