Adds text labels at the vertices of a ternary simplex with automatic positioning adjustments.
Arguments
- vertex_labels_df
A data frame containing vertex coordinates and labels. Should have columns
x1,x2, andlabels. Can be specified manually or obtained from a ternable object:ternable_object$simplex_vertices.- nudge_x
Numeric vector of length 3 specifying horizontal nudges for each vertex label.
- nudge_y
Numeric vector of length 3 specifying vertical nudges for each vertex label.
- ...
Arguments passed to
ggplot2::geom_text(), such assize,colour,fontface, etc.
Examples
library(ggplot2)
# Create a ternable object
aecdop22_transformed <- prefviz:::aecdop22_transformed
tern <- as_ternable(aecdop22_transformed, ALP:Other)
ggplot() +
add_ternary_base() +
add_vertex_labels(tern$simplex_vertices, size = 5, fontface = "bold")