Adds long-lat grid for projected data
long-lat grid lines are added to a map in the coordinate system specified, allowing for map projections wrapped differently from the 180 meridian.
gridlinesWrap(crs, easts=seq(-180,180,by=60), norths=seq(-90,90,by=30), ndiscr=40, plotLines=TRUE, plotLabels = TRUE, ...)
crs
: A character string representing a CRSeasts
: vector of longitudesnorths
: vector of latitudesndiscr
: number of intermediate points per lineplotLines
: add lines to existing plotplotLabels
: add labels to existing plot...
: Additional arguments passed to lines
or text
, for example lty=2
A list with elements lines
, containg the graticule lines, and points
containing the locations and labels for longitude and latitude values.
Patrick Brown
graticule
data('worldMap') worldMap = terra::unwrap(worldMap) crsMoll = moll(-100) worldMapT = wrapPoly(worldMap, crsMoll, buffer.width=200*1000) plot(attributes(crsMoll)$ellipse) plot(worldMapT, add=TRUE) gridlinesWrap(crsMoll, lty=3, col='red', cex=0.6)
Useful links