View source: R/add_vertex_labels.R
| add_vertex_labels | R Documentation |
Adds text labels at the vertices of a ternary simplex with automatic positioning adjustments.
add_vertex_labels(
vertex_labels_df,
nudge_x = c(-0.02, 0.02, 0),
nudge_y = c(-0.05, -0.05, 0.05),
...
)
vertex_labels_df |
A data frame containing vertex coordinates and labels.
Should have columns |
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 |
A ggplot object
library(ggplot2)
# Create a ternable object
tern <- as_ternable(prefviz::aecdop22_transformed, ALP:Other)
ggplot() +
add_ternary_base() +
add_vertex_labels(tern$simplex_vertices, size = 5, fontface = "bold")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.