From p.murrell@auckland.ac.nz  Tue Sep 17 05:04:05 2002
From: p.murrell@auckland.ac.nz (Paul Murrell)
Date: Tue, 17 Sep 2002 16:04:05 +1200
Subject: bug in layout?
References: <1031240376.1560.14.camel@localhost.localdomain>
 <1031275200.1403.3.camel@localhost.localdomain>
 <3D78061A.E99CC336@stat.auckland.ac.nz> <1031544048.23763.17.camel@sta123.stat.nus.edu.sg>
Message-ID: <3D86A9B5.9824A5EF@stat.auckland.ac.nz>

Hi


Nicholas Lewin-Koh wrote:
> 
> Hi,
> I think I am beginning to understand how this works, but obviously not
> fully. layout changes the following pars
> [1] "cxy"  "fig"  "fin"  "mfg"  "pin"  "plt"  "usr"  "xaxp" "yaxp"
> 
> and as you state below moves the counter to N so after layout is called
> if par is called one gets the pars for the Nth plot. Now after a call to
> plot.new() the counter is set to 1 and a call to par gets the pars() for
> the current plot.
> 
> what if I have a call to layout in a function, and i want to alter the
> parameter "pin" in the first plot? Advancing through using plot.new()
> does not seem to work because pin gets set each time the frame advances.
> 
> Any ideas?


Actually, layout() sets par(pin) only if you have not specified it
deliberately.  For example, the following respects the par(pin) setting
...

par(pin=c(1,1))
layout(matrix(c(1,1,0,2), 2, 2, byrow = TRUE))
plot.new()
plot.window(range(1:10), range(1:10))
points(1:10)
box()

... does that do something like what you want?  (you have to do
something like par(pty="m") if you want to "remove" the par(pin)
setting)

Paul
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


bug in layout?
Paul Murrell