R: Plot regular polygon: pentagon, hexagon, octagon

pgon {GEOmap} | R Documentation

## Plot regular polygon: pentagon, hexagon, octagon

### Description

Plot regular polygon: pentagon, hexagon, octagon

### Usage

    pgon(x,  y, siz=siz, col="black", border=NULL, K=5, startalph = -45, ... )

### Arguments

`x` | x-coordinate
`y` | y-coordinate
`siz` | radius or size
`col` | inside color
`border` | border color
`K` | number of sides per polygon
`startalph` | starting angle
`...` | graphical parameters

### Details

I figure is resized needs to be re-called.

### Value

Graphical Side Effects

### Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

### Examples

    N = 25
    x = rnorm(N)
    y = rnorm(N)

    z = rnorm(N)

    ######## draw pentagons
    plot(x,y, type='n', axes=FALSE, ann=FALSE)
    pgon(x,y, siz=abs(z)/10, col="white", border='black', startalph =60, K=5, lwd=.5, xpd=TRUE)

    ######   color the points, use 4-sided blocks
    rbow=rainbow(100)

    ss = sample(1:100, N, replace = TRUE, prob = NULL)
    plot(x,y, type='n', axes=FALSE, ann=FALSE)
    pgon(x,y, siz=abs(z)/10, col=rbow[ss], border='black', startalph =60, K=4, lwd=.5, xpd=TRUE)

[Package GEOmap version 2.4-0 Index]