Add texts to a track
spiral_text(
x,
y,
text,
offset = NULL,
gp = gpar(),
facing = c("downward", "inside", "outside", "clockwise", "reverse_clockwise",
"curved_inside", "curved_outside"),
letter_spacing = 0,
nice_facing = FALSE,
just = "centre",
hjust = NULL,
vjust = NULL,
track_index = current_track_index(),
...
)
X-locations of the texts.
Y-locations of the texts.
A vector of texts.
Radial offset of the text. The value should be a grid::unit()
object.
Graphical parameters.
Facing of the text.
Space between two letters. The value is a fraction of the width of current letter. It only works for curved texts.
If it is true, the facing will be automatically adjusted for texts which locate at different positions of the spiral. Note hjust
and vjust
will also be adjusted.
The justification of the text relative to (x, y). The same setting as in grid::grid.text()
.
Horizontal justification. Value should be numeric. 0 means the left of the text and 1 means the right of the text.
Vertical justification. Value should be numeric. 0 means the bottom of the text and 1 means the top of the text.
Index of the track.
Pass to grid::grid.text()
.
No value is returned.
For the curved text, it only supports one-line text.
x = seq(0.1, 0.9, length = 26)
text = strrep(letters, 6)
spiral_initialize(); spiral_track()
spiral_text(x, 0.5, text)
spiral_initialize(); spiral_track()
spiral_text(x, 0.5, text, facing = "inside")
spiral_initialize(); spiral_track()
spiral_text(x, 0.5, text, facing = "outside")
x = seq(0.1, 0.9, length = 10)
text = strrep(letters[1:10], 20)
spiral_initialize(); spiral_track()
spiral_text(x, 0.5, text, facing = "curved_inside")
spiral_initialize(); spiral_track()
spiral_text(x, 0.5, text, facing = "curved_outside")