[Rd] plot.times error -- missing or illegal tck parameter (PR#601)

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Wed, 12 Jul 2000 22:23:07 +0200


>>>>> maechler  writes:

>>>>> "JMd" == john maindonald <john.maindonald@anu.edu.au> writes:
JMd> There seems no default setting for tck, causing problems
JMd> for plot.times()

>>> library(chron)
>>> dts <- dates(c("02/27/92", "02/27/92", "01/14/92",
>        +                "02/28/92", "02/01/92"))
>>> y<-chron(dts,out.format=c("dmy","h:m:s"))
>>> y
>        [1] 270292 270292 140192 280292 010292
>>> plot(y,1:5)
>          Error in axis(n, at = at.x, labels = labels, ...) : 
>          invalid value specified for graphics parameter "tck".
>>> plot(y,1:5,tck=0.01)
>>> traceback()
>          [1] "axis(n, at = at.x, labels = labels, ...)"                     
>          [2] "axis.times(1, x, simplify = simplify, labels = T, adj = adj, "
>          [3] "    col = col, cex = cex, font = font, las = las, lab = lab, "
>          [4] "    mgp = mgp, tck = tck)"                                    
>          [5] "plot.times(y, 1:5)"                                           
>          [6] "plot(y, 1:5)"                                                 
>>> par()$tck
>          [1] NA

> Well, the default must be NA since   ?par says

help_par> tck: The length of tick marks as a fraction of the smaller of the
help_par> width or height of the plotting region. If `tck=1', grid
help_par> lines are drawn. The default setting is to use `tcl=-0.5'
help_par> (see below).
help_par> 
help_par> tcl: The length of tick marks as a fraction of the height of a
help_par> line of text.  The default value is `-0.5'.

> which is different than other dialects of S on purpose!

> So the bug is really in  plot.times only  which hasn't properly been
> ported from S-PLUS to R.

Not sure if I understand this correctly.

* First of all, I don't think the documentation is clear.  It explains
what tck is and then says that the default for tcl is something.  And,
it does not say that the default for tck is NA.

* Secondly, are you saying that in R we should rather use tcl than tck
and hence tck does not have a default value?  What happens if both tcl
and tck are set?

* If this is an intentional difference, should it be listed in the FAQ?

Re the chron problem, are you suggesting to replace `tck' by `tcl' in
code such as

    if(is.null(tck <- dots$tck)) tck <- par("tck")

    axis.times(..., tck = tck)

?

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