map.new {mapmisc} | R Documentation |
Prepare a plotting window suitable for a map
map.new(x,legendRight=FALSE, buffer=0, mar=c(0,0,0,0), ...)
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 |
mar |
see |
... |
Additional arguments passed to |
map.new
initiates a plot intended to contain a map covering the extent of x
,
with no margins.
Patrick Brown
Npoints = 20 myPoints = SpatialPointsDataFrame( cbind(runif(Npoints), 51+runif(Npoints)), data=data.frame(y1=c(NA, rnorm(Npoints-1)), y2=c(sample(0:5, Npoints-1,replace=TRUE), NA)), proj4string=CRS( "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0" ) ) map.new(myPoints, legendRight=TRUE, mar=c(3,3,0,0), buffer=0.2) points(myPoints) legendBreaks('right', list(breaks=1:3, col=1:2))