[Rd] par(lab= *) / axis(*) bug (PR#791)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Fri, 22 Dec 2000 10:59:24 +0100 (MET)


As the subject says,
here is example code (with comments) showing the problem:

p1 <- function(lab = c(8,12,7))
{
    ## This `fails' (on a virgin device)
    clab <- paste(lab,collapse=",")
    plot(1,1, xlim = c(0,15), ylim = c(-.8,1), type ="n", axes = FALSE,
         main=paste("plot(*,axes=F); par(lab= c(",clab,"));  axis(*) x 2",sep=""))
    box(col="gray80")
    op <- par(lab = lab) ; on.exit(par(op))
    axis(1, pos = 0)
    axis(2, pos = 0, las = 1)
    par(op)
    op
}

p2 <- function(lab = c(8,12,7))
{
    ## This works  [par()  *BEFORE*  plot() ]
    clab <- paste(lab,collapse=",")
    op <- par(lab = lab) ; on.exit(par(op))

    plot(1,1, xlim = c(0,15), ylim = c(-.8,1), type ="n", axes = FALSE,
         main=paste("par(lab= c(",clab,")); plot(*,axes=F); axis(*) x 2",sep=""))
    box(col="gray80")
    axis(1, pos = 0)
    axis(2, pos = 0, las = 1)
    op ## lab 5 5 7
}

dev.off()
par(mfrow=c(2,1), mar=c(2,2,3,1))
p1()
p2()




--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = Patched
 major = 1
 minor = 2.0
 year = 2000
 month = 12
 day = 19
 language = R

Search Path:
 .GlobalEnv, package:nls, package:splines, package:lqs, package:modreg, package:stepfun, package:mva, package:eda, package:ts, package:VLMC, package:ctest, package:SfS, Autoloads, package:base

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