addPolys {PBSmapping}R Documentation

Add a PolySet to an Existing Plot as Polygons

Description

Adds a PolySet to an existing plot, where each unique (PID, SID) describes a polygon.

Usage

addPolys (polys, xlim = NULL, ylim = NULL, polyProps = NULL,
          border = NULL, lty = NULL, col = NULL, colHoles = NULL,
          density = NA, angle = NULL, ...)

Arguments

polys PolySet to add (required).
xlim range of X-coordinates.
ylim range of Y-coordinates.
polyProps PolyData specifying which polygons to plot and their properties. par parameters passed as direct arguments supersede these data.
border vector describing edge colours (cycled by PID).
lty vector describing line types (cycled by PID).
col vector describing fill colours (cycled by PID).
colHoles vector describing hole colours (cycled by PID). If NULL, plot nothing in holes, allowing the background to show through. If NA, plot the outer polygons so that they fill the holes. If a color, first plot all of the outer polygons and then plot all of the holes.
density vector describing shading line densities (lines per inch, cycled by PID).
angle vector describing shading line angles (degrees, cycled by PID).
... additional par parameters for the polygon function.

Details

The plotting routine connects the last vertex of each discrete polygon to the first vertex of that polygon. It supports both borders (border, lty) and fills (col, density, angle). It clips polys to xlim and ylim before plotting.

For additional help on the arguments border, lty, col, density, and angle, please see polygon and par.

Value

PolyData consisting of the PolyProps used to create the plot.

See Also

addLabels, addStipples, clipPolys, closePolys, fixBound, fixPOS, locatePolys, plotLines, plotMap, plotPoints, plotPolys, thinPolys, thickenPolys.

Examples

#--- create a PolySet to plot
polys <- data.frame(PID=rep(1, 4), POS=1:4, X=c(0, 1, 1, 0), Y=c(0, 0, 1, 1))
polys <- as.PolySet(polys, projection=1)
#--- plot the PolySet
plotPolys(polys, xlim=c(-.5,1.5), ylim=c(-.5,1.5), density=0, projection=1)
#--- add the PolySet to the plot (in a different style)
addPolys(polys, col=3)

[Package PBSmapping version 2.09 Index]