Optimize the location of text labels to minimize overplotting text.
Usage
ternary_labels(x, y, z, ...)
# S4 method for class 'numeric,numeric,numeric'
ternary_labels(
x,
y,
z,
center = FALSE,
scale = FALSE,
labels = seq_along(x),
type = c("text", "shadow"),
...
)
# S4 method for class 'ANY,missing,missing'
ternary_labels(x, center = FALSE, scale = FALSE, labels = seq_along(x$x), ...)Arguments
- x, y, z
A
numericvector giving the x, y and z ternary coordinates of a set of points. Ifyandzare missing, an attempt is made to interpretxin a suitable way (seegrDevices::xyz.coords()).- ...
Further graphical parameters (see
graphics::par()) may also be supplied as arguments, particularly, character expansion,cexand color,col.- center
A
logicalscalar specifying wether the data should be centered, or anumericvector giving the center.- scale
A
logicalscalar specifying wether the data should be scaled, or anumericvector giving the scale factor.- labels
A
charactervector orexpressionspecifying the text to be written.- type
A
characterstring specifying the shape of the field. It must be one of "text" or "shadow". Any unambiguous substring can be given.
See also
Other geometries:
ternary_arrows(),
ternary_crosshairs(),
ternary_image(),
ternary_lines(),
ternary_points(),
ternary_polygon(),
ternary_segments(),
ternary_text()
Examples
## Compositional data
coda <- data.frame(
X = c(41.0, 40, 39.0),
Y = c(19.5, 20, 20.5),
Z = c(39.5, 40, 40.5)
)
## Add text
ternary_plot(NULL, panel.first = ternary_grid())
ternary_points(coda)
ternary_labels(coda, labels = c("A", "B", "C"))
