Annotate {Ternary} | R Documentation |
Annotate points on a ternary plot
Description
Annotate()
identifies and label individual points on a ternary diagram
in the plot margins.
Usage
Annotate(
coordinates,
labels,
side,
outset = 0.16,
line.col = col,
lty = par("lty"),
lwd = par("lwd"),
col = par("col"),
font = par("font"),
offset = 0.5,
...
)
Arguments
coordinates |
A list, matrix, data.frame or vector in which each element (or row) specifies the three coordinates of a point in ternary space. |
labels |
Character vector specifying text with which to annotate
each entry in |
side |
Optional vector specifying which side of the ternary
plot each point should be labelled on, using the notation |
outset |
Numeric specifying distance from plot margins to labels. |
line.col , lty , lwd |
parameters to |
col , font , offset |
parameters to |
... |
Further parameters to |
Author(s)
Martin R. Smith (martin.smith@durham.ac.uk)
See Also
Annotation vignette gives further suggestions for manual annotation.
Examples
# Load some data
data("Seatbelts")
seats <- c("drivers", "front", "rear")
seat <- Seatbelts[month.abb %in% "Oct", seats]
law <- Seatbelts[month.abb %in% "Oct", "law"]
# Set up plot
oPar <- par(mar = c(2, 0, 0, 0))
TernaryPlot(alab = seats[1], blab = seats[2], clab = seats[3])
TernaryPoints(seat, cex = 0.8, col = 2 + law)
# Annotate points by year
Annotate(seat, labels = 1969:1984, col = 2 + law)
# Restore original graphical parameters
par(oPar)