The R Project SVN R

Rev

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

Rev 27757 Rev 27759
Line 13... Line 13...
13
  \item{side}{an integer specifying which side of the plot the axis is
13
  \item{side}{an integer specifying which side of the plot the axis is
14
    to be drawn on.  The axis is placed as follows: 1=below,
14
    to be drawn on.  The axis is placed as follows: 1=below,
15
  2=left, 3=above and 4=right.}
15
  2=left, 3=above and 4=right.}
16
  \item{at}{the points at which tick-marks are to be drawn.  Non-finite
16
  \item{at}{the points at which tick-marks are to be drawn.  Non-finite
17
    (infinite, \code{NaN} or \code{NA}) values are omitted.  By default,
17
    (infinite, \code{NaN} or \code{NA}) values are omitted.  By default,
18
  when \code{NULL}, tickmark locations are computed, see Details below.}
18
    when \code{NULL}, tickmark locations are computed, see Details below.}
19
  \item{labels}{this can either be a logical value specifying whether
19
  \item{labels}{this can either be a logical value specifying whether
20
    (numerical) annotations are to be made at the tickmarks, or a vector
20
    (numerical) annotations are to be made at the tickmarks, or a vector
21
    of character strings to be placed at the tickpoints.}
21
    of character strings to be placed at the tickpoints.}
22
  \item{tick}{a logical value specifying whether tickmarks should be
22
  \item{tick}{a logical value specifying whether tickmarks should be
23
    drawn}.
23
    drawn}.
24
  \item{line}{the number of lines into the margin which the axis will
24
  \item{line}{the number of lines into the margin which the axis will
25
    be drawn.  This overrides the value of the graphical parameter
25
    be drawn.  This overrides the value of the graphical parameter
26
    \code{mgp[3]}.  The relative placing of tickmarks and tick labels
26
    \code{mgp[3]}.  The relative placing of tickmarks and tick labels
27
    is unchanged.}
27
    is unchanged.}
28
  \item{pos}{the coordinate at which the axis line is to be drawn.
28
  \item{pos}{the coordinate at which the axis line is to be drawn:
29
    this overrides the value of both \code{line} and \code{mgp[3]}.}
29
    this overrides the values of both \code{line} and \code{mgp[3]}.}
30
  \item{outer}{a logical value indicating whether the axis should be
30
  \item{outer}{a logical value indicating whether the axis should be
31
    drawn in the outer plot margin, rather than the standard plot
31
    drawn in the outer plot margin, rather than the standard plot
32
    margin.}
32
    margin.}
33
  \item{font}{font for text.}
33
  \item{font}{font for text.}
34
  \item{vfont}{vector font for text.}
34
  \item{vfont}{vector font for text.}
Line 57... Line 57...
57
  \code{\link{par}("usr", "lab")} and \code{\link{par}("xlog")} (or
57
  \code{\link{par}("usr", "lab")} and \code{\link{par}("xlog")} (or
58
  \code{"ylog"}).
58
  \code{"ylog"}).
59
 
59
 
60
  Several of the graphics parameters affect the way axes are drawn. The
60
  Several of the graphics parameters affect the way axes are drawn. The
61
  vertical (for sides 1 and 3) positions of the axis and the tick labels
61
  vertical (for sides 1 and 3) positions of the axis and the tick labels
62
  are controlled by \code{mpg}, the size of the ticks is controlled by
62
  are controlled by \code{mgp}, the size of the ticks is controlled by
63
  \code{tck} and \code{tcl} and the appearance of the tick labels by
63
  \code{tck} and \code{tcl} and the appearance of the tick labels by
64
  \code{cex.axis}, \code{col.axis} and \code{font.axis} with
64
  \code{cex.axis}, \code{col.axis} and \code{font.axis} with
65
  orientation controlled by \code{las} (but not \code{srt}).
65
  orientation controlled by \code{las} (but not \code{srt}, unlike S
-
 
66
  which uses \code{srt} if \code{at} is supplied and \code{las} if it is
-
 
67
  not).
66
}
68
}
67
\seealso{
69
\seealso{
68
  \code{\link{axTicks}} returns the axis tick locations
70
  \code{\link{axTicks}} returns the axis tick locations
69
  corresponding to \code{at=NULL}; \code{\link{pretty}} is more flexible
71
  corresponding to \code{at=NULL}; \code{\link{pretty}} is more flexible
70
  for computing pretty tick coordinates and does \emph{not} depend on
72
  for computing pretty tick coordinates and does \emph{not} depend on
Line 80... Line 82...
80
axis(1, 1:4, LETTERS[1:4])
82
axis(1, 1:4, LETTERS[1:4])
81
axis(2)
83
axis(2)
82
box() #- to make it look "as usual"
84
box() #- to make it look "as usual"
83
 
85
 
84
plot(1:7, rnorm(7), main = "axis() examples",
86
plot(1:7, rnorm(7), main = "axis() examples",
85
     type = "s", xaxt="n", frame = FALSE, col = "red")
87
     type = "s", xaxt = "n", frame = FALSE, col = "red")
86
axis(1, 1:7, LETTERS[1:7], col.axis = "blue")
88
axis(1, 1:7, LETTERS[1:7], col.axis = "blue")
87
# unusual options:
89
# unusual options:
88
axis(4, col = "violet", col.axis="dark violet",lwd = 2)
90
axis(4, col = "violet", col.axis="dark violet", lwd = 2)
89
axis(3, col = "gold", lty = 2, lwd = 0.5)
91
axis(3, col = "gold", lty = 2, lwd = 0.5)
90
}
92
}
91
\keyword{aplot}
93
\keyword{aplot}