.BG
.VE $Header: /usr/s/current/s/.help/RCS/axis,v 1.4 86/10/07 14:09:14 rab Exp $
.FN axis
.TL
axis: Add an Axis to the Current Plot
.CS
axis(side, at, labels, ticks, distn, line, pos, outer)
.PP
.AG side
side of plot for axis (1,2,3,4 for bottom, left, top,
right).
.AG at
optional vector of positions at which the ticks and tick
labels will be plotted.  If `side' is 1 or 3, `at'
represents x-coordinates.  If `side' is 2 or 4, `at'
represents y-coordinates.  If `at' is omitted, a the current
axis (as specified by the `xaxp' or `yaxp' parameters, see `par') will
be plotted.
.AG labels
optional.  If `labels' is logical, it specifies whether or
not to plot tick labels.  Otherwise, `labels' must be the
same length as `at', and `labels[i]' is plotted at coordinate
`at[i]'.  Default TRUE.
.AG ticks
logical, should tick marks and axis line be plotted?
Default TRUE.
.AG distn
optional character string describing the distribution used
for transforming the axis labels.  If `dist' is "normal",
then values of `at' are assumed to be probability levels,
and the labels are actually plotted at `qnorm(at)'.  This
also implies a reasonable default set of values for argument
`at'.
.AG line
line (measured out from the plot in units of standard-sized
character heights) at which the axis line will be plotted.
Tick labels will be plotted relative to this position (as
much as the tick labels and axis line differ in graphical
parameter `mgp').  Default 0, on the edge of the plot.
.AG pos
x or y coordinate position at which the axis line should be
plotted.  Labels will be on the side of the axis specified
by `side'.  If `pos' is omitted, argument `line' controls
positioning of the axis.
.AG outer
if TRUE, the axis will be drawn in the outer margin rather than
the standard plot margin.  Default FALSE.
.PP
Graphical parameters may also be supplied as arguments to this
function (see `par').
.EX
axis(3)  # add axis on top
axis(4,label=F)  # tick marks only on right

qqnorm(data)
axis(3,distn="normal")  # add normal probability axis at top

qqnorm(data,xaxt="n")   # normal prob plot, no x axis labels
probs <- c(.01, .05, .1, .9, .95, .99)
axis(1,dist="norm",at=probs,
   lab=encode(probs*100,"%"))  # add user-defined probability axis

plot(x,y,axes=F)  # scatter plot with no box or axes
axis(1,pos=0); axis(2,pos=0)  # coordinate axes through origin

plot(fahrenheit)  # time-series record of temperatures
celsius <- pretty((range(fahrenheit)-32)*5/9)
axis(side=4, at=celsius*9/5+32,lab=celsius)  # celsius at right
mtext(side=4,line=4,"Celsius")
.KW plot*
.KW aplot*
.WR
