ngonGrob

Share:

Description

regular polygon grob

Usage

1
2
3
4
ngonGrob(x, y, sides=5, size=1, angle=rep(pi/2, length(x)),
    ar=rep(1, length(x)), gp=gpar(colour = "grey50", fill =
    "grey90", linejoin = "mitre"), units.def="native",
    units.size="mm")

Arguments

x

x unit

y

y unit

sides

sides

size

size

angle

angle

ar

ar

units.def

units.def

units.size

units.size

gp

gpar

Value

grob

Examples

1
2
3
4
5
6
7
8
pushViewport(dataViewport(0:1, 0:1, width=unit(2, "cm"), height=unit(2, "cm")))

xy <- polygon.regular(6, TRUE)
grid.ngon(0.5, 0.5, 6, 10, units.size="mm")
for(ii in 1:NROW(xy)){
grid.ngon(xy[ii, 1]+0.5, xy[ii, 2]+0.5, 6, 10, units.size="mm")
}
upViewport()