Subject: Re: [R] axis function
From: Ben Bolker (ben@zoo.ufl.edu)
Date: Fri 26 May 2000 - 08:02:23 EST
Message-ID: <Pine.LNX.4.10.10005251741110.1202-100000@bolker.zoo.ufl.edu>
On Thu, 25 May 2000 zivan.karaman@limagrain.com wrote:
> In S-PLUS, the 'axis' function accepts some arguments that don't exist
> in the R counterpart.
>
> The two that I'm interested in right now are 'pos' and 'ticks'.
>
> Any suggestions on how obtain the same result with R?
>
Good news and bad news.
The good news: you can pass any graphics parameter to 'axis', including
"tck" (tick length--if set to zero this eliminates ticks) and "mgp" (which
is a three-place vector that sets the position of axis title, labels, and
lines respectively).
The bad news: only the second element of mgp (label position) seems to
have any effect (R 1.0.0, RH 6.0). This looks like a couple of bugs ...
## examples
par(mfrow=c(2,2))
## ticks on y-axis but not x-axis
plot(c(0,1),c(0,1),axes=FALSE)
axis(side=1,tck=0)
axis(side=2)
## attempt to move x-title in toward plot, doesn't work
plot(c(0,1),c(0,1),axes=FALSE)
axis(side=1,mgp=c(1,1,1),labels=FALSE)
axis(side=2,lwd=2)
## move x-labels away from plot
plot(c(0,1),c(0,1),axes=FALSE)
axis(side=1,mgp=c(1,4,1))
axis(side=2,lwd=2)
## try to move x-axis line, doesn't work
plot(c(0,1),c(0,1),axes=FALSE)
axis(side=1,mgp=c(1,1,4))
axis(side=2,lwd=2)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This archive was generated by hypermail 2b25 : Mon 17 Jul 2000 - 12:33:20 EST