addCoordsAxes: Add labels for XY axis on a map

Description Usage Arguments Details Examples

View source: R/addCoordsAxes.R

Description

Add labels for XY axis on a map

Usage

1
2
3
4
5
6
7
8
9
addCoordsAxes(
  xParams = NULL,
  yParams = NULL,
  where = c(1, 2),
  las = 1,
  labels = NULL,
  dms = "d",
  ...
)

Arguments

xParams

Parameters for X axis.

yParams

Parameters for Y axis.

where

character vector indicating where to show the labels for axis: 1 (bottom), 2 (left), 3 (top) or 4 (right).

las

numeric in 0,1,2,3; the style of axis labels. See par.

labels

character vector setting the labels for axis.

dms

A character strings indicating what to show (d: degrees, m: minutes, s: seconds).

...

Extra arguments passed to axis function (e.g. cex.axis), which is used internaly for ploting.

Details

xParams and yParams must contain axis information as a 3 or 4 length vector.

If labels is specified at ..., the function will consider this values for both xParams and yParams, so be carefull and use it separately (run the function twice for lon and lat).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
par(mar = c(2, 3, 1, 3), xaxs = "i", yaxs = "i")

xlim <- c(-85, -70)
ylim <- c(-20, -2)

plot(1, 1, type = "n", axes = FALSE, xlab = NA, ylab = NA, xlim = xlim, ylim = ylim)

addCoordsAxes(xParams = c(xlim, 5), yParams = c(ylim, 2), where = c(1, 2, 4))

box()

LuisLauM/ruisu documentation built on Jan. 31, 2020, 9:58 a.m.