axis(side, at=<<see below>>, labels=T, ticks=T, distn=NULL, line=0, pos=<<see below>>, outer=F)
Graphical parameters may also be supplied as arguments to this function (see par). However, arguments to title such as xlab and ylab are not allowed. For string rotation use the las graphical parameter: 0 = always parallel to the axis (the default), 1 = always horizontal to the axis, 2 = always perpendicular to the axis. The srt graphical parameter is ignored.
If at is not given, then axis uses the the following procedure to place the tick mark labels. axis rotates the tick mark labels to be parallel to the axes if the graphical parameter las is 0, horizontal if las is 1, and perpendicular to the axes if las is 2. (This overrides the current value of the graphical parameter srt.) The tick mark labels are centered at the tick mark if they are parallel to the axis and right or left justified if they are perpendicular to the axis and to the left or right of it, respectively. (This overrides the current value of the graphical parameter adj.)
If at is used to specify where to place the tick mark labels, then axis uses srt to specify how to rotate the labels (ignoring the las parameter and side argument) and it uses the adj parameter to specify the string adjustment (ignoring the side argument).
axis(3) # add axis on top axis(4, label=F) # tick marks only on rightqqnorm(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, distn="norm", at=probs, lab=paste(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
fahrenheit <- c(25, 28, 37, 49, 59, 69, 73, 71, 63, 52, 42, 29) plot(fahrenheit, axes=F, pch=12, xlab="", ylab="Fahrenheit", sub="Monthly Mean Temperatures for Hartford, Conn.") axis(2) axis(1, at=1:12, labels=month.abb) celsius <- pretty((range(fahrenheit)-32)*5/9) axis(side=4, at=celsius*9/5+32, lab=celsius, srt=90) # celsius at right mtext(side=4, line=4, "Celsius") box()