\HeaderA{axTicks}{Compute Axis Tickmark Locations}{axTicks}
\keyword{dplot}{axTicks}
\begin{Description}\relax
Compute pretty tickmark locations, the same way as \R{} does internally.
This is only non-trivial when \bold{log} coordinates are active.
By default, gives the \code{at} values which
\code{\LinkA{axis}{axis}(side)} would use.
\end{Description}
\begin{Usage}
\begin{verbatim}
axTicks(side, axp = NULL, usr = NULL, log = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{side}] integer in 1:4, as for \code{\LinkA{axis}{axis}}.
\item[\code{axp}] numeric vector of length three, defaulting to
\code{\LinkA{par}{par}("xaxp")} or \code{\LinkA{par}{par}("yaxp")}
depending on the \code{side} argument.
\item[\code{usr}] numeric vector of length four, defaulting to
\code{\LinkA{par}{par}("usr")} giving horizontal (\sQuote{x}) and vertical
(\sQuote{y}) user coordinate limits.
\item[\code{log}] logical indicating if log coordinates are active; defaults
to \code{\LinkA{par}{par}("xlog")} or \code{\LinkA{par}{par}("ylog")}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{axp}, \code{usr}, and \code{log} arguments must be consistent
as their default values (the \code{par(..)} results) are.  If you
specify all three (as non-NULL), the graphics environment is not used
at all.  Note that the meaning of \code{axp} alters very much when \code{log}
is \code{TRUE}, see the documentation on \code{\LinkA{par}{par}(xaxp=.)}.

\code{axTicks()} can be regarded as an \R{} implementation  of the
C function \code{CreateAtVector()} in \file{..../src/main/plot.c}
which is called by \code{\LinkA{axis}{axis}(side,*)} when no argument
\code{at} is specified.
\end{Details}
\begin{Value}
numeric vector of coordinate values at which axis tickmarks can be
drawn.  By default, when only the first argument is specified,
these values should be identical to those that
\code{\LinkA{axis}{axis}(side)} would use or has used.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{axis}{axis}}, \code{\LinkA{par}{par}}.  \code{\LinkA{pretty}{pretty}}
uses the same algorithm (but independently of the graphics
environment) and has more options.  However it is not available for
\code{log = TRUE.}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
 plot(1:7, 10*21:27)
 axTicks(1)
 axTicks(2)
 stopifnot(identical(axTicks(1), axTicks(3)),
           identical(axTicks(2), axTicks(4)))

## Show how axTicks() and axis() correspond :
op <- par(mfrow = c(3,1))
for(x in 9999*c(1,2,8)) {
    plot(x,9, log = "x")
    cat(formatC(par("xaxp"), width=5),";", T <- axTicks(1),"\n")
    rug(T, col="red")
}
par(op)
\end{ExampleCode}
\end{Examples}

