This function adds cardinal directions to axis labels in a map.

addAxis(side, at = axTicks(side), mgp = par()$mgp, digits = 0, ...)

Arguments

side

an integer between 1 (bottom x-Axis) and 4 (right y-Axis).

at

values on the axis to add labels.

mgp

customize axis positions. See par().

digits

number of digits of labels.

...

other parameters to pass to axis().

Author

Nicolas CASAJUS, nicolas.casajus@gmail.com

Examples

maps::map()
addFrame(grid = TRUE, add = TRUE, width = 5)
addAxis(1)
addAxis(2, at = seq(-50, 50, 100), digits = 2)
addAxis(3, lwd = 0, lwd.ticks = 0.5)
addAxis(4, las = 1, col.axis = "red")