plot.Map {maptools} | R Documentation |
The function plots a map object directly from the imported shapefile data.
plot.Map(x, recs, auxvar = NULL, add = FALSE, fg = "gray", ol = "black", prbg = NULL, glyph = 16, type = "q", nclass = 5, ...)
x |
a Map object returned by read.shape() |
recs |
a vector with the shapes to plot, if missing defaults to all shapes |
auxvar |
if the Map has polygon shapes, a variable from which to derive polygon fill colours using the computed class intervals |
add |
default FALSE, if TRUE add to existing plot |
fg |
foreground colour, can be used to pass through point and polygon colours, permitting the built-in class interval calculation to be avoided |
ol |
line/boundary colour |
prbg |
if not NULL, draw a rectangle around the plot in this colour |
glyph |
points plotted as this pch code |
type |
default "q" for quantile classes, can also be "e" for equal intervals |
nclass |
number of classes for class intervals |
... |
passed through to plotting functions |
Nicholas J. Lewin-Koh, modified by Roger Bivand Roger.Bivand@nhh.no
x <- read.shape(system.file("shapes/sids.shp", package="maptools")[1]) plot(x) n <- attr(x$Shapes,'nshps') nParts <- integer(n) for (i in 1:n) nParts[i] <- attr(x$Shapes[[i]], "nParts") table(nParts) cols <- c("azure", "blue", "orange") fgs <- cols[nParts] plot(x, fg=fgs)