Skip to content

axis and times() problem

3 messages · Gabor Grothendieck, Charles C. Berry, Martin Maechler

#
On Thu, 28 Dec 2006, Gabor Grothendieck wrote:

            
box() is making it look like the axes are different.

Axis()/axis() is behaving the same way in both cases.
[...]


Charles C. Berry                        (858) 534-2098
                                          Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	         UC San Diego
http://biostat.ucsd.edu/~cberry/         La Jolla, San Diego 92093-0717
#

        
ChuckB> On Thu, 28 Dec 2006, Gabor Grothendieck wrote:
>> The axes do not intersect with this command.  Is it a bug?

not at all, as Chuck demonstrated below.

  >> plot(c(.51, .6), bty = "n", xaxs = "i", yaxs = "i")

BTW: The same, an epsilon more efficient and also a bit more
"self-documenting", would be 

 plot(c(.51, .6), frame.plot = FALSE, xaxs = "i", yaxs = "i")

    >> If I remove the bty = "n" then they do intersect.

    ChuckB> box() is making it look like the axes are different.

    ChuckB> Axis()/axis() is behaving the same way in both cases.

In other words, the axes typically do *not* intersect at all.
Because most plot() methods {and plot.default() specifically}
end up calling box() which draws a rectangle ("box") around the
plotting region, many users may have got the wrong
interpretation of  intersecting axes.

They are not, as Chuck's example nicely shows :

    >> par(mfrow=c(1,2))
    >> plot(c(.51, .6), bty = "n", xaxs = "i", yaxs = "i")
    >> box(lty=2)
    >> plot(c(.51, .6), xaxs = "i", yaxs = "i")
    >> axis(4,col=2)

    ChuckB> [...]

Martin Maechler, ETH Zurich