pos_honeycomb.Rd
Title
pos_honeycomb( x0 = 0, y0 = 0, n = 5, ncol = 3, width = 2 * sqrt(0.75), height = width * 0.75/sqrt(0.75) )
x0 | numeric x start position |
---|---|
y0 | numeric y start position |
n | number of positions |
ncol | number of columns before wrap, default is 3 |
width | numeric, width between positions |
height | numeric, height between positions |
# first example pos_honeycomb()#> x0 y0 #> 1 0.0000000 0.0 #> 2 1.7320508 0.0 #> 3 3.4641016 0.0 #> 4 0.8660254 -1.5 #> 5 2.5980762 -1.5ggcanvas() + stamp_point(xy = pos_honeycomb()) + stamp_polygon(x0y0 = pos_honeycomb(n = 15, ncol = 4), alpha = .5) + stamp_label(label = 1:15, xy = pos_honeycomb(n = 15, ncol = 4)) + stamp_polygon(n = 4, x0y0 = pos_honeycomb(n = 15, ncol = 4)[15,], fill = "magenta", alpha = .4, radius = sqrt(.75))# get coords for single position pos_honeycomb(n = 15, ncol = 5)[15,]#> x0 y0 #> 15 6.928203 -3pos_honeycomb(n = 15, ncol = 5)[1:4,]#> x0 y0 #> 1 0.000000 0 #> 2 1.732051 0 #> 3 3.464102 0 #> 4 5.196152 0# a hive ggcanvas() + stamp_polygon(x0y0 = pos_honeycomb(width = 1.8), fill = c("goldenrod3"), alpha = .8, size = 0) + stamp_polygon(x0y0 = pos_honeycomb(width = 1.8, n = 12)[c(6:9, 11),], fill = c("goldenrod4"), alpha = .8, size = 0) + stamp_polygon(x0y0 = pos_honeycomb(width = 1.8, n = 15)[c(10,12:15),], fill = c("goldenrod2"), alpha = .8, size = 0) + stamp_png(x0y0 = pos_honeycomb(width = 1.8, n = 15)[c(1,5, 10),])#> Warning: Raster pixels are placed at uneven horizontal intervals and will be shifted. Consider using geom_tile() instead.#> Warning: Raster pixels are placed at uneven vertical intervals and will be shifted. Consider using geom_tile() instead.