Plot a Map object (deprecated)
This function is deprecated. It is difficult to maintain and there are several alternatives, either by converting Map objects to sp class objects or polylist etc. objects. (The function plots a map object directly from the imported shapefile data).
## S3 method for class 'Map': plot(x, recs, auxvar = NULL, add = FALSE, fg = "gray", ol = "black", prbg = NULL, glyph = 16, color='red', type = "q", nclass = 5, \dots)
- a Map object returned by read.shape()
- a vector with the shapes to plot, if missing defaults to all shapes; if fg is not equal to the length of recs, all fg are set to fg
- if the Map has polygon shapes, a variable from which to derive polygon fill colours using the computed class intervals, must be same length as number of shapes
- default FALSE, if TRUE add to existing plot
- foreground colour, can be used to pass through point and polygon colours, permitting the built-in class interval calculation to be avoided; if fg is not equal to the length of recs, all fg are set to fg
- line/boundary colour; boundaries may be removed by setting to NA oe "transparent"
- if not NULL, draw a rectangle around the plot in this colour
- points plotted as this pch code
- base colour for color.ramp(); default "red"
- default "q" for quantile classes for color.ramp(), can also be "e" for equal intervals
- number of classes for class intervals
- passed through to plotting functions
- If the
auxvarvariable is not used, the function returns NULL, otherwise it returns the list constructed by
ramp vector of colours col.class vector of classes breaks class intervals given as argument to cut
x <- read.shape(system.file("shapes/sids.shp", package="maptools")) plot(x) nParts <- sapply(x$Shapes, function(x) attr(x, "nPart")) table(nParts) cols <- c("azure", "blue", "orange") fgs <- cols[nParts] plot(x, fg=fgs) res <- plot(x, auxvar=x$att.data$BIR74) str(res) res <- plot(x, auxvar=x$att.data$BIR74, type="e") str(res)
Looks like there are no examples yet.