rescale_polygon_list | R Documentation |
Rescale a polygon_list object
rescale_polygon_list(
polygon_list,
rotate_degrees = 0,
scale = c(1, 1),
shift = c(0, 0),
center = NULL,
share_center = FALSE,
share_polygon_center = TRUE,
...
)
polygon_list |
|
rotate_degrees |
|
scale |
|
shift |
|
center |
|
share_center |
|
... |
additional arguments are ignored. |
This function simply applies rescale_coordinates()
to an
list
polygon_list object.
object list
polygon_list
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()
,
nudge_polygon_list()
,
plot_polygon_list()
,
polygon_areas()
,
polygon_circles()
,
polygon_ellipses()
,
polygon_list_labelr()
,
polygon_list_to_xy_list()
,
simple_ellipse()
,
union_polygon_list()
,
xy_list_to_polygon_list()
polygon_list <- polygon_ellipses(c(3, 2), c(2, 3),
xradius=c(1, 4),
yradius=c(5, 2))
polygon_list1 <- intersect_polygon_list(polygon_list);
polygon_list2 <- minus_polygon_list(polygon_list[1:2]);
polygon_list3 <- minus_polygon_list(polygon_list[2:1]);
polygon_list123 <- c(polygon_list1,
polygon_list2,
polygon_list3);
polygon_list123a <- rescale_polygon_list(polygon_list123,
scale=c(1.5, 1.5),
share_center=TRUE);
polygon_list123b <- rescale_polygon_list(polygon_list123,
scale=c(1.5, 1.5));
col3 <- c("#FF000077", "#FFDD0077", "#0000DD77");
par("mfrow"=c(2, 2));
plot_polygon_list(polygon_list123,
col=col3,
main="original polygons",
xlim=c(-10, 15), ylim=c(-5, 10));
axis(1, las=2); axis(2, las=2);
plot_polygon_list(polygon_list123a,
col=col3,
main="share_center=TRUE",
xlim=c(-10, 15), ylim=c(-5, 10));
axis(1, las=2); axis(2, las=2);
plot_polygon_list(polygon_list123[1:2],
col=col3[1:2],
main="share_center=FALSE\nrescaling only the blue polygon",
xlim=c(-10, 15), ylim=c(-5, 10));
axis(1, las=2); axis(2, las=2);
plot_polygon_list(polygon_list123b[3],
col=col3[3],
add=TRUE);
plot_polygon_list(polygon_list123[2:3],
col=col3[2:3],
main="share_center=FALSE\nrescaling only the red polygon",
xlim=c(-10, 15), ylim=c(-5, 10));
axis(1, las=2); axis(2, las=2);
plot_polygon_list(polygon_list123b[1],
col=col3[1],
add=TRUE);
par("mfrow"=c(1, 1));
{par("mfrow"=c(2, 2));
plot_polygon_list(polygon_list123, col=col3,
xlim=c(-4, 8), ylim=c(-4, 8))
title(main="Original polygons", line=0);
plot_polygon_list(rescale_polygon_list(polygon_list123, rotate_degrees=c(`11`=45, `12`=-10)), col=col3,
xlim=c(-4, 8), ylim=c(-4, 8))
title(sub="yellow +45 degrees\nblue -10 degrees", line=0,
main="share_polygon_center=TRUE (default)")
plot_polygon_list(rescale_polygon_list(polygon_list123, rotate_degrees=c(`11`=45, `12`=-10), share_polygon_center=FALSE), col=col3,
xlim=c(-4, 8), ylim=c(-4, 8))
title(sub="yellow +45 degrees\nblue -10 degrees", line=0,
main="share_polygon_center=FALSE\n(each polygon uses its center)")
plot_polygon_list(rescale_polygon_list(polygon_list123, rotate_degrees=c(`11`=45, `12`=-10), share_center=TRUE), col=col3,
xlim=c(-4, 8), ylim=c(-4, 8))
title(sub="yellow +45 degrees\nblue -10 degrees", line=0,
main="share_center=TRUE\n(all polygons share one global center)")
par("mfrow"=c(1, 1));}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.