View source: R/CRdraw_polygon.R
CRdraw_polygon | R Documentation |
Draws polygon defined in polygon_list to rendering target. Polygon is defined in a polygon_list containing ordered vectors of vertices x and y.
CRdraw_polygon(graphics_list, polygon_list, status = NULL)
graphics_list |
List containing pointers to window, renderer etc. created with |
polygon_list |
List defining a polygon, containing vector-elements x and y. |
status |
Optional list |
CRdraw_polygon
internally uses same drawing method as CRdraw_lines
. Polygon is automatically "closed" at the end: a line is implicitly added from last to first vertex.
CRset_render_color(gs, list(r = 0, g = 0, b = 0))
CRrender_clear(gs)
CRset_render_color(gs, list(r = 100, g = 0, b = 0))
poly <- list(x = c(100, 50, 70, 130, 150),
y = c(50, 80, 130, 130, 80))
CRdraw_polygon(gs, poly)
CRrender_present(gs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.