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,
...
)
layer object handle, layer id
widget path name as a string
vector of x coordinates
vector of y coordinates
vector with text strings
color of text
font size
text rotation
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.
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 used in the layers inspector
group layer
of the newly added layer in its parent group
a logical determining whether objects appear or not
(default is TRUE
for all).
additional state initialization arguments, see
l_info_states
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")
l_layer
, l_info_states
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)
}
Run the code above in your browser using DataLab