Dynamically wrap text.
split_text_grob(
text,
x = grid::unit(0.5, "npc"),
y = grid::unit(0.5, "npc"),
width = grid::unit(1, "npc"),
just = "centre",
hjust = NULL,
vjust = NULL,
default.units = "npc",
name = NULL,
gp = grid::gpar(),
vp = NULL
)
A text grob
.
(string
)
the text to wrap.
A numeric vector or unit object specifying x-values.
A numeric vector or unit object specifying y-values.
(grid::unit
)
a unit object specifying maximum width of text.
The justification of the text
relative to its (x, y) location. If there are two values, the first
value specifies horizontal justification and the second value specifies
vertical justification. Possible string values are: "left"
,
"right"
, "centre"
, "center"
, "bottom"
,
and "top"
. For numeric values, 0 means left (bottom) alignment
and 1 means right (top) alignment.
A numeric vector specifying horizontal justification.
If specified, overrides the just
setting.
A numeric vector specifying vertical justification.
If specified, overrides the just
setting.
A string indicating the default units to use
if x
or y
are only given as numeric vectors.
A character identifier.
An object of class "gpar"
, typically the output
from a call to the function gpar
. This is basically
a list of graphical parameter settings.
A Grid viewport object (or NULL).
This code is taken from R Graphics by Paul Murell, 2nd edition