R-alpha: hist()

Peter Dalgaard BSA p.dalgaard@kubism.ku.dk
10 Sep 1997 18:40:15 +0200

If you try hist(rnorm(100),lwd=2) with a recent snapshot, you get the
exact opposite effect of what was earlier argued to be desirable in
plots: you get fat axes and thin bar outlines. The cause is plain to
see, at the end of 'hist':

        title(main = main, xlab = xlab, ylab = ylab, ...)
        if (axes) {
                axis(1, ...)
                axis(2, ...)
        rect(breaks[-length(breaks)], 0, breaks[-1], counts, 
                col = col, border = border)

The ...'s are doing it, obviously. So the fix would be to remove ...
from axis() and add it to rect().

However, this example is having me worried that it wasn't a good idea
to depart from the S rule of *always* passing graphical parameters to
lower level routines. For instance, I don't think you would want a
font change *not* passed on to title(), would you? Then what *is*
changeable matter in a plot, really?

The thing that I'm afraid of is that it will become a can of worms to
keep track of which parameters are passed on to what routines. Not to
mention the fact that the ... parameter is essentially indivisible: it
is, to say the least, difficult to pass only some of the parameters.

Cc-ed to R-devel. I think we need to discuss this more broadly.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
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