Re: [R] unexpected par('pin') behaviour

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Fri 15 Jul 2005 - 22:36:16 EST

Thank you, Joerg,
for the reproducable example  

>>>>> "joerg" == joerg van den hoff <j.van_den_hoff@fz-rossendorf.de>
>>>>> on Thu, 14 Jul 2005 17:19:51 +0200 writes:

  ......................
  ......................

    joerg> ===========cut====================
    joerg> graphics.off()
    joerg> f <- function(n=7, m=6) {
    joerg> nm <- n*m
    joerg> layout(matrix(1:(nm),n,m))
    joerg> opar <- par(no.readonly = T)
    joerg> on.exit(par(opar))
    joerg> par(mar = c(4.1, 4.1, 1.1, 0.1))
    joerg> for (i in 1:nm) plot(i, pch=(i-1)%%25+1)
    joerg> layout(1)
    joerg> }
    joerg> f(5) #good
    joerg> par('pin')
    joerg> f()  #bad (at least for x11() default size)
    joerg> par('pin')
    joerg> ===========cut====================

which I can simplify to

  graphics.off()
  layout(matrix(1:42,7,6))
  par("pin")

  ## [1] 0.2918620 -0.2974408 --- when using x11() "default"

clearly a bug in layout() {which I'll file}

and it seems to me, one that is not shared by par(mfrow= / mfcol=) settings.

Martin Maechler, ETH Zurich



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 Received on Fri Jul 15 22:40:19 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:45 EST