Annotate | R Documentation |
Annotate()
identifies and label individual points on a ternary diagram
in the plot margins.
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,
...
)
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 |
Martin R. Smith (martin.smith@durham.ac.uk)
Annotation vignette gives further suggestions for manual annotation.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.