Learn R Programming

mapmisc (version 2.1.0)

map.new: Start a new map

Description

Prepare a plotting window suitable for a map

Usage

map.new(x,legendRight=FALSE, buffer=0, mar=c(0,0,0,0), ...)

Value

A list of the graphical parameters prior to calling map.new

Arguments

x

A spatial object from which an extent can be extracted.

legendRight

Leave room to the right for the legend produced by plotting a Raster object

buffer

passed to extend to increase the plotting area

mar

see par

...

Additional arguments passed to plot

Author

Patrick Brown

Details

map.new initiates a plot intended to contain a map covering the extent of x, with no margins.

Examples

Run this code

nldTiles = terra::unwrap(nldTiles)
nldCities = terra::unwrap(nldCities)


oldpar = map.new(nldCities)
plot(nldTiles, add=TRUE)
points(nldCities)
par(oldpar)

Run the code above in your browser using DataLab