[R] Graphic aspect ratio

2009-05-12 Thread MikSmith

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.

thanks

mike
-- 
View this message in context: 
http://www.nabble.com/Graphic-aspect-ratio-tp23503495p23503495.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


Re: [R] Graphic aspect ratio

2009-05-12 Thread Paul Murrell
Hi


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),
   respect=TRUE)
for (i in 1:6) plot(1:i)


Paul


 thanks
 
 mike

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
p...@stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/

__
R-help@r-project.org 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.