gridExtra (version 0.6.5)

ngonGrob: ngonGrob

Description

regular polygon grob

Usage

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

Run this code
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()

Run the code above in your browser using DataLab