\Header{text}{Add Text to a Plot}
\alias{text.default}{text}
\keyword{aplot}{text}
\begin{Usage}
\begin{verbatim}
text (x, ...)
text.default (x, y = NULL, labels = seq(along = x), adj = NULL, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x, y}] numeric vectors of coordinates where the text
\texttt{labels} should be written.  If the length of \texttt{x} and
\texttt{y} differs, the shorter one is recycled.
\item[\texttt{labels}] character or expression with the \emph{text} to be
written.
\item[\texttt{adj}] character or expression with the \emph{text} to be
written.
\item[\texttt{...}] further graphical parameters (from \texttt{\Link{par}}),
such as \texttt{cex}, etc.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{text} draws the strings given in the vector \texttt{labels} at the
coordinates given by \texttt{x} and \texttt{y}.
\texttt{y} may be missing since \texttt{\Link{xy.coords}(x,y)} is used for
construction of the coordinates.\end{Description}
\begin{Details}
\texttt{labels} must be of type \texttt{\Link{character}} or
\texttt{\Link{expression}}.  In the latter case, quite a bit of
mathematical notation is available such as sub- and superscripts,
greek letters, fractions, etc.

\texttt{adj} allows \emph{adj}ustment of the text with respect to \texttt{(x,y)}.\end{Details}
\begin{SeeAlso}
\texttt{\Link{mtext}}, \texttt{\Link{title}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
plot(-1:1,-1:1, type = "n", xlab = "Re", ylab = "Im")
K <- 16; text(exp(1i * 2 * pi * (1:K) / K), col = 2)

plot(1:10, 1:10, main = "text(..) examples\n~~~~~~~~~~~~~~",
     sub = "R is GNU ©, but not ® ..")
mtext("«ISO-accents»: ± éè øØ å<Å æ<Æ", side=3)
points(c(6,2), c(2,1), pch = 3, cex = 4, col = "red")
text(6, 2, "the text is CENTERED around (x,y) = (6,2) by default",
     cex = .8)
text(2, 1, "or Left/Bottom - JUSTIFIED at (2,1) by `adj = c(0,0)'",
     adj = c(0,0))
text(4, 9, expression(hat(beta) == (X^t * X)^{-1} * X^t * y))
text(4, 8.4, "expression(hat(beta) == (X^t * X)^{-1} * X^t * y)", cex = .6)
text(4, 7, expression(bar(x) == sum(frac(x[i], n), i==1, n)))
text(4, 6.4, "expression(bar(x) == sum(frac(x[i], n), i==1, n))", cex = .6)
text(8, 5, expression(paste(frac(1, sigma*sqrt(2*pi)), " ",
                            plain(e)^{frac(-(x-mu)^2, 2*sigma^2)})))

text(5,10.2,"Le français, c'est façile: Règles, Liberté, Egalité, Fraternité..")
text(5,9.8, "Jetz no chli züritüütsch: (noch ein bißchen Zürcher deutsch)")
\end{ExampleCode}
\end{Examples}

