R 1.5.0: axis() does not honor the xaxp argument (PR#1654)

p.murrell@auckland.ac.nz p.murrell@auckland.ac.nz
Wed, 12 Jun 2002 00:04:45 +0200 (MET DST)


Hi


> ----------------------- transcript --------------------------
> $ R --vanilla
> 
> R : Copyright 2002, The R Development Core Team
> Version 1.5.0  (2002-04-29)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type `license()' or `licence()' for distribution details.
> 
> R is a collaborative project with many contributors.
> Type `contributors()' for more information.
> 
> Type `demo()' for some demos, `help()' for on-line help, or
> `help.start()' for a HTML browser interface to help.
> Type `q()' to quit R.
> 
> > plot(c(0,1),c(0.2,0.3),xaxt="n")
> > axis(1,xaxp=c(0,1,4))
> > version
>          _
> platform i586-pc-linux-gnu
> arch     i586
> os       linux-gnu
> system   i586, linux-gnu
> status
> major    1
> minor    5.0
> year     2002
> month    04
> day      29
> language R
> >
> ------------------------end transcript ---------------------
> 
> I expect only 4 intervals on the x-axis, but find 5 intervals.  The same
> problem seems to exist for axis() with a yaxp argument.
> 
> The sequence:
> 
> > plot(c(0,1),c(0.2,0.3),xaxt="n")
> > par(xaxp=c(0,1,4))
> > axis(1)
> 
> does draw an axis with four intervals, though.
> 
> On R-Help, in response to my question about this, Paul Murrell
> <p.murrell@auckland.ac.nz> wrote:
> 
> > This appears to be a bug.  axis() should respond to an "in-line" xaxp
> > setting.
> >
> > I can see a place in the C code where the problem appears to be, but an
> > attempted quick fix failed.


For the record, the place in the C code is in plot.c in do_axis where
there appear to be two problems:  (i)  the code sets a local variable
from the dpptr(dd)->xaxp rather than the gpptr(dd)->xaxp, and (ii) the
code sets this local variable BEFORE calling ProcessInlinePars().  So
there are two obstacles to fix before do_axis will respond to an in-line
xaxp setting.  NOTE also that several other local variables are set from
dpptr(dd)-><something> in the same place, so these should be fixed as
well.

Paul

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