Description Usage Arguments Author(s) See Also Examples
Adds label to points in a a plot, unsing an index.
1 2 |
x, y |
numeric vectors of coordinates where the text
|
ind |
vector of the indices of data points to be marked with a label. |
labels.id |
vector of the identtification strings of data points to be marked with a label. |
adj.x |
used to calculate |
cex.id |
numeric character expansion factor; passed to |
label.pos |
used to calculate |
... |
further graphical parameters (from |
This is code extracted from function locator
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, y, ind, labels.id = rownames(x), adj.x = TRUE, cex.id = 0.75,
label.pos = c(4, 2), ...)
{
x <- x[ind]
y <- y[ind]
labels.id <- labels.id[ind]
labpos <- if (adj.x)
label.pos[1 + as.numeric(x > mean(range(x)))]
else 3
text(x, y, labels.id, cex = cex.id, xpd = TRUE, pos = labpos,
offset = 0.25, ...)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.