Skip to content
Prev 5860 / 398506 Next

axis function

On Thu, 25 May 2000, Ben Bolker wrote:

            
pos has nothing to do with mgp: it is the position on the plot in user
coordinates. Bill Venables reported it as lacking to R-bugs a little while
ago. The problem is that the current R code has hard-coded the axis labels
to be in the margins, not in the plot area itself.  pos is used to, for
example, put an axis in the middle of a plot region. For example

plot(c(0,1),c(-0.5,,1),axes=FALSE, xaxs="i")
axis(side=1, pos=0)
axis(side=2)

in S puts an axis at y=0.
That is not what ticks=F does, either. It omits the axis line too and just
plots the labels.

plot(c(0,1),c(0,1),axes=FALSE)   
axis(side=1, ticks=FALSE)

gives an axis with 0.0  ...  1.0  and nothing else.
That's not a bug. It is plot not axis that puts the x-title on. Try

plot(c(0,1),c(0,1),axes=FALSE, mgp=c(1,1,1))
axis(side=1,mgp=c(1,1,1),labels=FALSE)
True.  In S that can also be done by argument line, that moves the axis
as a whole (including ticks and labels), and mgp[3] measures the
displacement from the line as moved by line=foo.