AddNorthArrow: Add North Arrow to Plot

Description Usage Arguments Value Author(s) See Also Examples

View source: R/AddNorthArrow.R

Description

Add a north arrow aligned to true north to a plot.

Usage

1
AddNorthArrow(crs = sp::CRS(), len = 0.05, lab = "N", rotate = 0, ...)

Arguments

crs

'CRS', 'Raster*', or 'Spatial'. Coordinate reference system (CRS), or any object with a CRS attribute that can be extracted using the crs function. If missing (the default) the north arrow is point to the top of the plot unless the rotate argument is specified.

len

'numeric' number. Arrow length expressed as a fraction of the plot height, by default is 5-percent.

lab

'character' string. North label, by default is “N”.

rotate

'numeric' number. Arrow offset-rotation in degrees, where positive values are taken to be clockwise.

...

Additional arguments to be passed to the GetInsetLocation function—used to position the north arrow in the main plot region.

Value

Invisible NULL

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

PlotMap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
m <- datasets::volcano
m <- m[nrow(m):1, ncol(m):1]
x <- seq(from = 2667405, length.out = ncol(m), by = 10)
y <- seq(from = 6478705, length.out = nrow(m), by = 10)
r <- raster::raster(m, xmn = min(x), xmx = max(x),
                    ymn = min(y), ymx = max(y),
                    crs = "+init=epsg:27200")
PlotMap(r, pal = GetColors(scheme = "DEM screen"))
AddNorthArrow(raster::crs(r), loc = "center")
AddNorthArrow(raster::crs(r), inset = 0.1)
AddNorthArrow(raster::crs(r), loc = "topleft", inset = 0.1)

inlmisc documentation built on Jan. 25, 2022, 1:14 a.m.