| Line 50... |
Line 50... |
| 50 |
such as \code{srt}, \code{family} and \code{xpd}.}
|
50 |
such as \code{srt}, \code{family} and \code{xpd}.}
|
| 51 |
}
|
51 |
}
|
| 52 |
\description{
|
52 |
\description{
|
| 53 |
\code{text} draws the strings given in the vector \code{labels} at the
|
53 |
\code{text} draws the strings given in the vector \code{labels} at the
|
| 54 |
coordinates given by \code{x} and \code{y}.
|
54 |
coordinates given by \code{x} and \code{y}.
|
| 55 |
\code{y} may be missing since \code{\link{xy.coords}(x,y)} is used for
|
55 |
\code{y} may be missing since \code{\link{xy.coords}(x, y)} is used for
|
| 56 |
construction of the coordinates.
|
56 |
construction of the coordinates.
|
| 57 |
}
|
57 |
}
|
| 58 |
\details{
|
58 |
\details{
|
| 59 |
\code{labels} must be of type \code{\link{character}} or
|
59 |
\code{labels} must be of type \code{\link{character}} or
|
| 60 |
\code{\link{expression}} (or be coercible to such a type).
|
60 |
\code{\link{expression}} (or be coercible to such a type).
|
| 61 |
In the latter case, quite a bit of
|
61 |
In the latter case, quite a bit of
|
| 62 |
mathematical notation is available such as sub- and superscripts,
|
62 |
mathematical notation is available such as sub- and superscripts,
|
| 63 |
greek letters, fractions, etc.
|
63 |
greek letters, fractions, etc.
|
| 64 |
|
64 |
|
| 65 |
\code{adj} allows \emph{adj}ustment of the text with respect to \code{(x,y)}.
|
65 |
\code{adj} allows \emph{adj}ustment of the text with respect to
|
| - |
|
66 |
\code{(x, y)}.
|
| 66 |
Values of 0, 0.5, and 1 specify left/bottom, middle and
|
67 |
Values of 0, 0.5, and 1 specify left/bottom, middle and
|
| 67 |
right/top alignment, respectively. The default is for centered text, i.e.,
|
68 |
right/top alignment, respectively. The default is for centered text, i.e.,
|
| 68 |
\code{adj = c(0.5, NA)}. Accurate vertical centering needs
|
69 |
\code{adj = c(0.5, NA)}. Accurate vertical centering needs
|
| 69 |
character metric information on individual characters which is
|
70 |
character metric information on individual characters which is
|
| 70 |
only available on some devices. Vertical alignment is done slightly
|
71 |
only available on some devices. Vertical alignment is done slightly
|
| Line 132... |
Line 133... |
| 132 |
\code{\link{Hershey}} for details on Hershey vector fonts,
|
133 |
\code{\link{Hershey}} for details on Hershey vector fonts,
|
| 133 |
\code{\link{plotmath}} for details and more examples on
|
134 |
\code{\link{plotmath}} for details and more examples on
|
| 134 |
mathematical annotation.
|
135 |
mathematical annotation.
|
| 135 |
}
|
136 |
}
|
| 136 |
\examples{
|
137 |
\examples{
|
| 137 |
plot(-1:1,-1:1, type = "n", xlab = "Re", ylab = "Im")
|
138 |
plot(-1:1, -1:1, type = "n", xlab = "Re", ylab = "Im")
|
| 138 |
K <- 16; text(exp(1i * 2 * pi * (1:K) / K), col = 2)
|
139 |
K <- 16; text(exp(1i * 2 * pi * (1:K) / K), col = 2)
|
| 139 |
|
140 |
|
| 140 |
## The following two examples use latin1 characters: these may not
|
141 |
## The following two examples use latin1 characters: these may not
|
| 141 |
## appear correctly (or be omitted entirely).
|
142 |
## appear correctly (or be omitted entirely).
|
| 142 |
plot(1:10, 1:10, main = "text(...) examples\n~~~~~~~~~~~~~~",
|
143 |
plot(1:10, 1:10, main = "text(...) examples\n~~~~~~~~~~~~~~",
|
| Line 151... |
Line 152... |
| 151 |
text(4, 8.4, "expression(hat(beta) == (X^t * X)^{-1} * X^t * y)",
|
152 |
text(4, 8.4, "expression(hat(beta) == (X^t * X)^{-1} * X^t * y)",
|
| 152 |
cex = .75)
|
153 |
cex = .75)
|
| 153 |
text(4, 7, expression(bar(x) == sum(frac(x[i], n), i==1, n)))
|
154 |
text(4, 7, expression(bar(x) == sum(frac(x[i], n), i==1, n)))
|
| 154 |
|
155 |
|
| 155 |
## Two more latin1 examples
|
156 |
## Two more latin1 examples
|
| 156 |
text(5,10.2,
|
157 |
text(5, 10.2,
|
| 157 |
"Le français, c'est façile: Règles, Liberté, Egalité, Fraternité...")
|
158 |
"Le français, c'est façile: Règles, Liberté, Egalité, Fraternité...")
|
| 158 |
text(5,9.8,
|
159 |
text(5, 9.8,
|
| 159 |
"Jetz no chli züritüütsch: (noch ein bißchen Zürcher deutsch)")
|
160 |
"Jetz no chli züritüütsch: (noch ein bißchen Zürcher deutsch)")
|
| 160 |
}
|
161 |
}
|
| 161 |
\keyword{aplot}
|
162 |
\keyword{aplot}
|