nudge_polygon_list | R Documentation |
Nudge polygon_list
nudge_polygon_list(polygon_list = NULL, nudge = NULL, ...)
polygon_list |
|
nudge |
|
... |
additional arguments are ignored. |
rotate_degrees |
|
This helper function is intended to take list
polygon_list coordinates
and "nudge" (move by adding a scalar value to each coordinate)
only a subset of polygons identified by name.
object list
polygon_list object with "x"
and "y"
elements.
Other venndir polygons:
bbox_polygon_list()
,
eulerr_to_polygon_list()
,
get_largest_polygon_list()
,
get_venn_polygon_shapes()
,
intersect_polygon_list()
,
labelr_polygon_list()
,
minus_polygon_list()
,
nudge_polygon_coords()
,
plot_polygon_list()
,
polygon_areas()
,
polygon_circles()
,
polygon_ellipses()
,
polygon_list_labelr()
,
polygon_list_to_xy_list()
,
rescale_polygon_list()
,
simple_ellipse()
,
union_polygon_list()
,
xy_list_to_polygon_list()
D <- list(
x=c(-3, 3, 3, 0, -3),
y=c(-3, -3, 1.5, 4, 1.5))
E <- list(
x=c(-3, 3, 3, -3),
y=c(-3, -3, 3, 3))
DElist <- list(D=D, E=E, DE=list(D=D, E=E))
nudge <- list(D=c(x=0, y=10), E=c(x=0, y=-10), DE=c(x=10, y=0))
new_polygon_list <- nudge_polygon_list(polygon_list=DElist,
nudge=nudge)
poly_colors <- colorjam::rainbowJam(3, alpha=0.5);
plot_polygon_list(DElist, col=poly_colors)
plot_polygon_list(new_polygon_list, col=poly_colors)
polygon_list <- polygon_ellipses(c(3, 2), c(2, 3),
xradius=c(1, 4),
yradius=c(5, 2))
plot_polygon_list(polygon_list,
col=c("#FF000077", "#FFDD0000"),
xlim=c(-2, 9));
polygon_list2 <- nudge_polygon_list(polygon_list,
nudge=list(`2`=c(x=3, y=-2))
)
plot_polygon_list(polygon_list2,
col=c("#FF000077", "#FFDD0077"),
add=TRUE,
xlim=c(-2, 9));
plot_polygon_list(polygon_list[2], border="blue", lty="dotted", lwd=3, add=TRUE);
plot_polygon_list(polygon_list2[2], border="blue", lty="dotted", lwd=3, add=TRUE);
arrows(x0=2, x1=5, y0=3, y1=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.