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.

l_layer_polygons(widget, x, y, color = "gray80", linecolor = "black",
  linewidth = 1, label = "polygons", parent = "root", index = 0,
  ...)

Arguments

widget

widget path name as a string

x

list with vectors with x coordinates

y

list with vectors with y coordinates

color

vector with fill colors, if empty string "", then the fill is transparant

linecolor

vector with outline colors

linewidth

vector with line widths

label

label used in the layers inspector

parent

group layer

index

of the newly added layer in its parent group

...

additional state initialization arguments, see l_info_states

Value

layer object handle, layer id

Details

For more information run: l_help("learn_R_layer")

See also

Examples

p <- l_plot() l <- l_layer_polygons( p, x = list(c(1,2,1.5), c(3,4,6,5,2), c(1,3,5,3)), y = list(c(1,1,2), c(1,1.5,1,4,2), c(3,5,6,4)), color = c('red', 'green', 'blue'), linecolor = "" ) l_scaleto_world(p) l_info_states(l, "color")
#> $color #> $color$type #> [1] "colorOrTransparent" #> #> $color$dimension #> [1] "n" #> #> $color$defaultvalue #> [1] "" #> #> $color$description #> [1] "fill colors of polygons" #> #>