The R Project SVN R

Rev

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

Rev 59039 Rev 61153
Line 51... Line 51...
51
    \emph{parallel} (\sQuote{horizontal}) to the reading direction.  If
51
    \emph{parallel} (\sQuote{horizontal}) to the reading direction.  If
52
    this is not a finite value, the default is used (centring for
52
    this is not a finite value, the default is used (centring for
53
    strings parallel to the axis, justification of the end nearest the
53
    strings parallel to the axis, justification of the end nearest the
54
    axis otherwise).}
54
    axis otherwise).}
55
  \item{padj}{adjustment for each tick label \emph{perpendicular} to the
55
  \item{padj}{adjustment for each tick label \emph{perpendicular} to the
56
    reading direction.  For labels parallel to the axes, \code{padj=0}
56
    reading direction.  For labels parallel to the axes, \code{padj = 0}
57
    means right or top alignment, and \code{padj=1} means left or bottom
57
    means right or top alignment, and \code{padj = 1} means left or bottom
58
    alignment.  This can be a vector given a value for each string, and
58
    alignment.  This can be a vector given a value for each string, and
59
    will be recycled as necessary.
59
    will be recycled as necessary.
60
 
60
 
61
    If \code{padj} is not a finite value (the default), the value of
61
    If \code{padj} is not a finite value (the default), the value of
62
    \code{par("las")} determines the adjustment.  For strings plotted
62
    \code{par("las")} determines the adjustment.  For strings plotted
Line 88... Line 88...
88
\details{
88
\details{
89
  The axis line is drawn from the lowest to the highest value of
89
  The axis line is drawn from the lowest to the highest value of
90
  \code{at}, but will be clipped at the plot region.  By default, only
90
  \code{at}, but will be clipped at the plot region.  By default, only
91
  ticks which are drawn from points within the plot region (up to a
91
  ticks which are drawn from points within the plot region (up to a
92
  tolerance for rounding error) are plotted, but the ticks and their
92
  tolerance for rounding error) are plotted, but the ticks and their
93
  labels may well extend outside the plot region.  Use \code{xpd=TRUE}
93
  labels may well extend outside the plot region.  Use \code{xpd = TRUE}
94
  or \code{xpd=NA} to allow axes to extend further.
94
  or \code{xpd = NA} to allow axes to extend further.
95
 
95
 
96
  When \code{at = NULL}, pretty tick mark locations are computed internally
96
  When \code{at = NULL}, pretty tick mark locations are computed internally
97
  (the same way \code{\link{axTicks}(side)} would) from
97
  (the same way \code{\link{axTicks}(side)} would) from
98
  \code{\link{par}("xaxp")} or \code{"yaxp"} and
98
  \code{\link{par}("xaxp")} or \code{"yaxp"} and
99
  \code{\link{par}("xlog")} (or \code{"ylog"}).  Note that these
99
  \code{\link{par}("xlog")} (or \code{"ylog"}).  Note that these
100
  locations may change if an on-screen plot is resized (for example, if
100
  locations may change if an on-screen plot is resized (for example, if
101
  the \code{plot} argument \code{asp} (see \code{\link{plot.window}}) is set.)
101
  the \code{plot} argument \code{asp} (see \code{\link{plot.window}}) is set.)
102
 
102
 
103
  If \code{labels} is not specified, the numeric values supplied or
103
  If \code{labels} is not specified, the numeric values supplied or
104
  calculated for \code{at} are converted to character strings as if they
104
  calculated for \code{at} are converted to character strings as if they
105
  were a numeric vector printed by \code{\link{print.default}(digits=7)}.
105
  were a numeric vector printed by \code{\link{print.default}(digits = 7)}.
106
 
106
 
107
  The code tries hard not to draw overlapping tick labels, and so will
107
  The code tries hard not to draw overlapping tick labels, and so will
108
  omit labels where they would abut or overlap previously drawn labels.
108
  omit labels where they would abut or overlap previously drawn labels.
109
  This can result in, for example, every other tick being labelled.
109
  This can result in, for example, every other tick being labelled.
110
  (The ticks are drawn left to right or bottom to top, and space at
110
  (The ticks are drawn left to right or bottom to top, and space at
Line 127... Line 127...
127
}
127
}
128
\seealso{
128
\seealso{
129
  \code{\link{Axis}} for a generic interface.
129
  \code{\link{Axis}} for a generic interface.
130
 
130
 
131
  \code{\link{axTicks}} returns the axis tick locations
131
  \code{\link{axTicks}} returns the axis tick locations
132
  corresponding to \code{at=NULL}; \code{\link{pretty}} is more flexible
132
  corresponding to \code{at = NULL}; \code{\link{pretty}} is more flexible
133
  for computing pretty tick coordinates and does \emph{not} depend on
133
  for computing pretty tick coordinates and does \emph{not} depend on
134
  (nor adapt to) the coordinate system in use.
134
  (nor adapt to) the coordinate system in use.
135
 
135
 
136
  Several graphics parameters affecting the appearance are documented
136
  Several graphics parameters affecting the appearance are documented
137
  in \code{\link{par}}.
137
  in \code{\link{par}}.
Line 150... Line 150...
150
 
150
 
151
plot(1:7, rnorm(7), main = "axis() examples",
151
plot(1:7, rnorm(7), main = "axis() examples",
152
     type = "s", xaxt = "n", frame = FALSE, col = "red")
152
     type = "s", xaxt = "n", frame = FALSE, col = "red")
153
axis(1, 1:7, LETTERS[1:7], col.axis = "blue")
153
axis(1, 1:7, LETTERS[1:7], col.axis = "blue")
154
# unusual options:
154
# unusual options:
155
axis(4, col = "violet", col.axis="dark violet", lwd = 2)
155
axis(4, col = "violet", col.axis = "dark violet", lwd = 2)
156
axis(3, col = "gold", lty = 2, lwd = 0.5)
156
axis(3, col = "gold", lty = 2, lwd = 0.5)
157
 
157
 
158
# one way to have a custom x axis
158
# one way to have a custom x axis
159
plot(1:10, xaxt = "n")
159
plot(1:10, xaxt = "n")
160
axis(1, xaxp=c(2, 9, 7))
160
axis(1, xaxp = c(2, 9, 7))
161
}
161
}
162
\keyword{aplot}
162
\keyword{aplot}