bug in layout?

Paul Murrell p.murrell@auckland.ac.nz
Tue, 17 Sep 2002 16:04:05 +1200


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._