| mark_text | R Documentation |
Add a text/label mark
mark_text(spec, ..., data = NULL, style = list(), smart_repel = TRUE)
spec |
A glyph_spec |
... |
Aesthetic mappings (x, y, color, size, shape, alpha, tooltip) |
data |
Optional per-mark data override |
style |
Named list of fixed visual properties |
smart_repel |
Automatically avoid label overlaps (TRUE by default). Inspired by ggrepel, but simpler: rather than a full force-directed simulation, glyph resolves overlaps by iterative pairwise nudging. It repeatedly compares every pair of label bounding boxes and, for any pair that still overlaps, pushes them a small step apart vertically (up to 50 passes, stopping as soon as none overlap). |
Modified glyph_spec object with the text mark added
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.