Hi I am trying to set up 16 graphs on one graphics page in R. I have used the mfrow=c(4,4) command. However I get a lot of white space between each graph. Does anyone know how I can reduce this? Thanks Sam
Sam Baxter wrote:> Hi > > I am trying to set up 16 graphs on one graphics page in R. I have used > the mfrow=c(4,4) command. However I get a lot of white space between > each graph. Does anyone know how I can reduce this? > > Thanks > > Sam > > ______________________________________________ > R-help at 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 >?layout as an alternative to par(mfrow) might be helpful anyway too large margins: ?par reduce value of "mar", for instance
Sam Baxter wrote:> Hi > > I am trying to set up 16 graphs on one graphics page in R. I have used > the mfrow=c(4,4) command. However I get a lot of white space between > each graph. Does anyone know how I can reduce this? > > Thanks > > Sam >Two options: 1. play around with the `mar' parameter in ?par. 2. (Preferred) Use the lattice package. See, for example: library(lattice) trellis.device(theme = col.whitebg()) z <- expand.grid(x = 1:10, y = 1:10, g = LETTERS[1:16]) xyplot(y ~ x | g, z) HTH, --sundar
"Sam Baxter" <s.j.baxter at reading.ac.uk> wrote in message news:42DFA00E.2090506 at rdg.ac.uk...> I am trying to set up 16 graphs on one graphics page in R. I have used > the mfrow=c(4,4) command. However I get a lot of white space between > each graph. Does anyone know how I can reduce this?The default par()$mar is c(5,4,4,2) + 0.1 and can be reduced. For example: par(mfrow=c(4,4), mar=c(3,3,0,0)) for (i in 1:16) { plot(0:10) } efg -- Earl F. Glynn Bioinformatics Department Stowers Institute for Medical Research