Is there a possibility to minimize the interspace between the graphs or better is it possible to overlap the graphs a little bit? example from ?lm: ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) anova(lm.D9 <- lm(weight ~ group)) summary(lm.D90 <- lm(weight ~ group - 1))# omitting intercept summary(resid(lm.D9) - resid(lm.D90)) #- residuals almost identical opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) plot(lm.D9, las = 1) # Residuals, Fitted, ... par(opar) With regards Carmen
You want to change the settings of the margins (mar not oma). Try mar=c(2.1, 4.1, 2.1, 0) as a starting point. On Tue, 12 Dec 2006, Carmen Meier wrote:> Is there a possibility to minimize the interspace between the graphs or > better is it possible to overlap the graphs a little bit? > > example from ?lm: > > ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) > trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) > group <- gl(2,10,20, labels=c("Ctl","Trt")) > weight <- c(ctl, trt) > anova(lm.D9 <- lm(weight ~ group)) > summary(lm.D90 <- lm(weight ~ group - 1))# omitting intercept > summary(resid(lm.D9) - resid(lm.D90)) #- residuals almost identical > > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(lm.D9, las = 1) # Residuals, Fitted, ... > par(opar)-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
If you really want to overlap the graphs, then look at the subplot function in the TeachingDemos package (you would first need to create a blank graph with no or minimal margins, then use subplot to place your graphs within the blank graph). You may also want to look at the lattice package for doing arrays of graphs with the graph boxes aligning and axes only on the outer plots. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at intermountainmail.org (801) 408-8111 -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Carmen Meier Sent: Tuesday, December 12, 2006 9:37 AM To: R-help Subject: [R] par(mfrow .. how to minimize the interspace Is there a possibility to minimize the interspace between the graphs or better is it possible to overlap the graphs a little bit? example from ?lm: ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) anova(lm.D9 <- lm(weight ~ group)) summary(lm.D90 <- lm(weight ~ group - 1))# omitting intercept summary(resid(lm.D9) - resid(lm.D90)) #- residuals almost identical opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) plot(lm.D9, las = 1) # Residuals, Fitted, ... par(opar) With regards Carmen ______________________________________________ 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 and provide commented, minimal, self-contained, reproducible code.