[R] How to put multiple plots in the same window? (not par(mf row=))

Austin, Matt maustin at amgen.com
Fri Jul 30 17:56:31 CEST 2004


Lattice graphics may be the answer depending on your exact problem.

Here is an example of four traditional plots without space:

par(mfrow=c(2,2), omi=c(.5, .5, .5, .5))
par(mar=c(0, 2, 2, 0))
  plot(rnorm(10), rnorm(10), axes=FALSE)
  box(); axis(2); axis(3)
par(mar=c(0, 0, 2, 2))
  plot(rnorm(10), rnorm(10), axes=FALSE) 
  box(); axis(3); axis(4)
par(mar=c(2, 2, 0, 0))
  plot(rnorm(10), rnorm(10), axes=FALSE)
  box(); axis(1); axis(2)
par(mar=c(2, 0, 0, 2))
  plot(rnorm(10), rnorm(10), axes=FALSE); box()
  box(); axis(1); axis(4)

I have generalized this in the past to allow for more (in a for loop I
think), but I don't have access to my home computer from here.

--Matt



-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of F Duan
Sent: Friday, July 30, 2004 8:42 AM
To: r-help at stat.math.ethz.ch
Subject: [R] How to put multiple plots in the same window? (not
par(mfrow=))


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

______________________________________________
R-help at 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




More information about the R-help mailing list