Re: [R] How to put multiple plots in the same window? (not par(mfrow=))

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Sat 31 Jul 2004 - 02:27:31 EST

F Duan wrote:
> Dear All,
>
> I am sorry if this question has been asked before. Below is my Question:
>
> I want to put several plots in the same window, but I donít want the blank
> space between plots (like par(mfrow=)) --- that makes the plots too small.
> Could anyone tell me how to do it?
>
> Thanks a lot.
>
> Frank

?split.screen
?layout

are alternatives to par(mfrow = c()), but I think you need to look at the margins of the plots and reduce them to suit your purposes. See ?par and argument mar. For example:

oldpar <- par(mfrow = c(2,2), mar = c(3,3,1,1) + 0.1)

plot(1:10)
plot(1:10)
plot(1:10)
plot(1:10)

par(oldpar)

# or

layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)) layout.show(4)
oldpar <- par(mar=c(3,3,1,1) + 0.1)

plot(1:10)
plot(1:10)
plot(1:10)
plot(1:10)

par(oldpar)

There is no room for labels/titles but adjust the mar to suit your requirements.

Gav

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson                     [T] +44 (0)20 7679 5522
ENSIS Research Fellow             [F] +44 (0)20 7679 7565
ENSIS Ltd. & ECRC                 [E] gavin.simpson@ucl.ac.uk
UCL Department of Geography       [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way                    [W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sat Jul 31 03:08:49 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:41:26 EST