R: Plot geographic regions defined as polygons

polys.plot {mgcv} | R Documentation

## Plot geographic regions defined as polygons

### Description

Produces plots of geographic regions defined by polygons, optionally filling the polygons with a color or grey shade dependent on a covariate.

### Usage

    polys.plot(pc,z=NULL,scheme="heat",lab="",...)

### Arguments

`pc` | A named list of matrices. Each matrix has two columns. The matrix rows each define the vertex of a boundary polygon. If a boundary is defined by several polygons, then each of these must be separated by an `NA` row in the matrix. See `mrf` for an example.
`z` | A vector of values associated with each area (item) of `pc`. If the vector elements have names then these are used to match elements of `z` to areas defined in `pc`. Otherwise `pc` and `z` are assumed to be in the same order. If `z` is `NULL` then polygons are not filled.
`scheme` | One of `"heat"` or `"grey"`, indicating how to fill the polygons in accordance with the value of `z`.
`lab` | label for plot.
`...` | other arguments to pass to plot (currently only if `z` is `NULL`).

### Details

Any polygon within another polygon counts as a hole in the area. Further nesting is dealt with by treating any point that is interior to an odd number of polygons as being within the area, and all other points as being exterior. The routine is provided to facilitate plotting with models containing `mrf` smooths.

### Value

Simply produces a plot.

### Author(s)

Simon Wood simon.wood@r-project.org

### See Also

`mrf` and `columb.polys`.

### Examples

    ## see also ?mrf for use of z
    require(mgcv)
    data(columb.polys)
    polys.plot(columb.polys)

[Package mgcv version 1.8-3 Index]