R-alpha: plot, axis & log

Arne Kovac Arne Kovac <maak@stats.bris.ac.uk>
Fri, 9 May 1997 23:34:26 +0100 (BST)


The following commands crash:

> plot(1:4,axes=F,log="x")
> axis(1,c(1,2,3,4))
zsh: segmentation fault  R

Lines 35-37 of axis():

35:        else {
36:                ind <- (usr[1] <= at & at <= usr[2])
37:        }

should be replaced by

        else {
                if (log)
                        ind <- (10^usr[1] <= at & at <= 10^usr[2])
                else ind <- (usr[1] <= at & at <= usr[2])
        }

Moreover, there should be a check if length(at) equals zero before calling
the internal axis command.

But wait, there's more:

> plot(1:4,log="x")
> plot(1:4)

The second call of plot produces an empty plot. The following sequence
works:

> plot(1:4,log="x")
> par(xlog=F)
> plot(1:4)        

Why does R have the graphical parameters "xlog" and "ylog"? They do not
seem to work for me and are not used by S-Plus.

Arne 

-- 
Arne Kovac
School of Mathematics                    Phone: +44 (0117) 942 7551
University of Bristol                    A.Kovac@bristol.ac.uk    
University Walk, Bristol, BS8 1TW, U.K.  http://www.stats.bris.ac.uk/~maak

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-