Arne.Muller at sanofi-aventis.com
2006-Sep-15 13:32 UTC
[R] graphics and 'layout' question
Hello, I got stuck with a graphics question: I've 3 figures that I present on a single page (window) via 'layout'. The layout is layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); so that the frst plot spans the both columns in row one. Now I'd like to magnify the fist figure so that it takes 20% more vertical space (i.e. more space for the y-axis). How would I do this in R? thanks a lot for your help, Arne
Arne.Muller at sanofi-aventis.com wrote:> Hello, > > I got stuck with a graphics question: I've 3 figures that I present on a single page (window) via 'layout'. The layout is > > layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); > > so that the frst plot spans the both columns in row one. Now I'd like to magnify the fist figure so that it takes 20% more vertical space (i.e. more space for the y-axis). How would I do this in R?Are you looking for the heights argument? For example: nf <- layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE), heights=c(70,30)) layout.show(nf)> thanks a lot for your help, > > Arne > > ______________________________________________ > 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.-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894
Arne.Muller at sanofi-aventis.com wrote:> Hello, > > I got stuck with a graphics question: I've 3 figures that I present > on a single page (window) via 'layout'. The layout is > > layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); > > so that the frst plot spans the both columns in row one. Now I'd like > to magnify the fist figure so that it takes 20% more vertical space > (i.e. more space for the y-axis). How would I do this in R?From ?layout heights: a vector of values for the heights of rows on the device. Relative and absolute heights can be specified, see 'widths' above. So something like layout(matrix(c(1,1,2,3),2,2,byrow = TRUE), heights = c(0.6, 0.4)) should do the trick. Best, Jim> > thanks a lot for your help, > > Arne > > ______________________________________________ > 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.-- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
Use the heights parameter in the layout function, as shown in ?layout. For example, to get the first figure to be twice as tall as the other two, use:> layout(matrix(c(1,1,2,3),2,2,byrow=TRUE),heights=c(2,1)) > layout.show(3)On 15/09/06, Arne.Muller@sanofi-aventis.com <Arne.Muller@sanofi-aventis.com> wrote:> > Hello, > > I got stuck with a graphics question: I've 3 figures that I present on a > single page (window) via 'layout'. The layout is > > layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); > > so that the frst plot spans the both columns in row one. Now I'd like to > magnify the fist figure so that it takes 20% more vertical space (i.e. > more space for the y-axis). How would I do this in R? > > thanks a lot for your help, > > Arne > > ______________________________________________ > R-help@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. >-- ================================David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP [[alternative HTML version deleted]]