ternary_labels {isopleuros}R Documentation

Non-Overlapping Text Labels

Description

Optimize the location of text labels to minimize overplotting text.

Usage

ternary_labels(x, y, z, ...)

## S4 method for signature 'numeric,numeric,numeric'
ternary_labels(x, y, z, labels = seq_along(x), ...)

## S4 method for signature 'ANY,missing,missing'
ternary_labels(x, labels = seq_along(x$x), ...)

Arguments

x, y, z

A numeric vector giving the x, y and z ternary coordinates of a set of points. If y and z are missing, an attempt is made to interpret x in a suitable way (see grDevices::xyz.coords()).

...

Further graphical parameters (see graphics::par()) may also be supplied as arguments, particularly, character expansion, cex and color, col.

labels

A character vector or expression specifying the text to be written.

Value

ternary_labels() is called it for its side-effects.

Author(s)

N. Frerebeau

See Also

graphics::text()

Other geometries: ternary_arrows(), ternary_crosshairs(), 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"))

[Package isopleuros version 1.2.0 Index]