| text {base} | R Documentation |
Add Text to a Plot
Description
text draws the strings given in the vector labels at the
coordinates given by x and y.
y may be missing since xy.coords(x,y) is used for
construction of the coordinates.
Usage
text (x, ...)
text.default (x, y = NULL, labels = seq(along = x), adj = NULL, ...)
Arguments
x, y |
numeric vectors of coordinates where the text
|
labels |
character or expression with the text to be written. |
adj |
character or expression with the text to be written. |
... |
further graphical parameters (from |
Details
labels must be of type character or
expression. In the latter case, quite a bit of
mathematical notation is available such as sub- and superscripts,
greek letters, fractions, etc.
adj allows adjustment of the text with respect to (x,y).
See Also
mtext, title.
Examples
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~~~~~~~~~~~~~~",