Loon's displays that are based on Cartesian coordinates (i.e. scatterplot, histogram and graph display) allow for layering visual information including polygons, text and rectangles.
Layer a vector of character strings.
l_layer_texts( widget, x, y, text, color = "gray60", size = 6, angle = 0, anchor = "center", justify = "center", label = "texts", parent = "root", index = 0, active = TRUE, ... )
widget | widget path name as a string |
---|---|
x | vector of x coordinates |
y | vector of y coordinates |
text | vector with text strings |
color | color of text |
size | font size |
angle | text rotation |
anchor | specifies how the information in a text is to be displayed in the widget. Must be one of the values c("n", "ne", "e", "se", "s", "sw", "w", "nw", "center"). For example, "nw" means display the information such that its top-left corner is at the top-left corner of the widget. |
justify | when there are multiple lines of text displayed in a widget, this option determines how the lines line up with each other. Must be one of c("left", "center", "right"). "Left" means that the lines' left edges all line up, "center" means that the lines' centers are aligned, and "right" means that the lines' right edges line up. |
label | label used in the layers inspector |
parent | group layer |
index | of the newly added layer in its parent group |
active | a logical determining whether objects appear or not
(default is |
... | additional state initialization arguments, see
|
layer object handle, layer id
As a side effect of Tcl
's text-based design, it is best to
use l_layer_text
if one would like to layer a single character
string (and not l_layer_texts
with n=1
).
For more information run: l_help("learn_R_layer")
if(interactive()){ p <- l_plot() l <- l_layer_texts(p, x=1:3, y=3:1, text=c("This is", "a", "test"), size=20) l_scaleto_world(p) }