[R] Graphic aspect ratio

Paul Murrell p.murrell at auckland.ac.nz
Tue May 12 23:23:08 CEST 2009


MikSmith wrote:
> Hi
> I've been playing with a 3x2 graphics device using the default size as it
> appears on screen. This has given me tall thin plots which I can resize by
> dragging the window and increasing the window width. However I was wondering
> if I can force R to produce square plots or set the actual aspect ratio. asp
> seems to affect data units, not on-screen pixel units.

Sounds like you need a layout, for example ...

par(mar=c(4, 4, 1, 1))
layout(matrix(1:6, nrow=3),
       widths=rep(2, 2),
       heights=rep(1, 3),
for (i in 1:6) plot(1:i)


> thanks
> mike

Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz

More information about the R-help mailing list