The R Project SVN R

Rev

Rev 61153 | Rev 76185 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61153 Rev 61168
Line 43... Line 43...
43
  when \code{log} is \code{TRUE}; see the documentation on
43
  when \code{log} is \code{TRUE}; see the documentation on
44
  \code{\link{par}(xaxp = .)}.
44
  \code{\link{par}(xaxp = .)}.
45
 
45
 
46
  \code{axTicks()} can be used an \R interface to the C function
46
  \code{axTicks()} can be used an \R interface to the C function
47
  \code{CreateAtVector()} in \file{..../src/main/plot.c}
47
  \code{CreateAtVector()} in \file{..../src/main/plot.c}
48
  which is called by \code{\link{axis}(side,*)} when no argument
48
  which is called by \code{\link{axis}(side, *)} when no argument
49
  \code{at} is specified.
49
  \code{at} is specified.
50
  The delicate case, \code{log = TRUE}, now makes use of
50
  The delicate case, \code{log = TRUE}, now makes use of
51
  \code{\link{axisTicks}} (in package \pkg{grDevices}) unless
51
  \code{\link{axisTicks}} (in package \pkg{grDevices}) unless
52
  \code{nintLog = Inf} which exists for back compatibility.
52
  \code{nintLog = Inf} which exists for back compatibility.
53
}
53
}
Line 71... Line 71...
71
 axTicks(2)
71
 axTicks(2)
72
 stopifnot(identical(axTicks(1), axTicks(3)),
72
 stopifnot(identical(axTicks(1), axTicks(3)),
73
           identical(axTicks(2), axTicks(4)))
73
           identical(axTicks(2), axTicks(4)))
74
 
74
 
75
## Show how axTicks() and axis() correspond :
75
## Show how axTicks() and axis() correspond :
76
op <- par(mfrow = c(3,1))
76
op <- par(mfrow = c(3, 1))
77
for(x in 9999*c(1,2,8)) {
77
for(x in 9999 * c(1, 2, 8)) {
78
    plot(x,9, log = "x")
78
    plot(x, 9, log = "x")
79
    cat(formatC(par("xaxp"), width = 5),";", T <- axTicks(1),"\n")
79
    cat(formatC(par("xaxp"), width = 5),";", T <- axTicks(1),"\n")
80
    rug(T, col =  adjustcolor("red", 0.5), lwd = 4)
80
    rug(T, col =  adjustcolor("red", 0.5), lwd = 4)
81
}
81
}
82
par(op)
82
par(op)
83
 
83
 
Line 103... Line 103...
103
 
103
 
104
## Prove that we got it right :
104
## Prove that we got it right :
105
plot(0:1, ylims, log = "y", yaxs = "i")
105
plot(0:1, ylims, log = "y", yaxs = "i")
106
stopifnot(all.equal(aT.i, axTicks(side = 2)))
106
stopifnot(all.equal(aT.i, axTicks(side = 2)))
107
 
107
 
108
plot(0:1, ylims, log = "y" ,yaxs = "r")
108
plot(0:1, ylims, log = "y", yaxs = "r")
109
stopifnot(all.equal(aT.r, axTicks(side = 2)))
109
stopifnot(all.equal(aT.r, axTicks(side = 2)))
110
}
110
}
111
\keyword{dplot}
111
\keyword{dplot}
112
 
112