paxes: Display axes for projected coordinates

Description Usage Arguments Details See Also Examples

View source: R/paxes.R

Description

paxes addes x and y axes to an existing plot for projected coordinates.

Usage

1
paxes(proj, xlim, ylim, xaxp, yaxp, grid = TRUE, axis.args, ...)

Arguments

proj

A character string indicating what projection should be used for the included x and y coordinates. The default is "none". The other valid choices correspond to the "projection" argument in the mapproject function, which is used for the projection.

xlim

A vector with the minimum and maximum value of the x coordinates. Taken from par("usr") if not provided.

ylim

A vector with the minimum and maximum value of the y coordinates. Taken from par("usr") if not provided.

xaxp

A vector of the form c(x1, x2, n) giving the coordinates of the extreme tick marks and the number of intervals between tick marks. Overrides xlim.

yaxp

A vector of the form c(x1, x2, n) giving the coordinates of the extreme tick marks and the number of intervals between tick marks. Overrides ylim.

grid

A logical value indicating whether grid lines should be displayed with the axes. Default is TRUE.

axis.args

A named list with components matching the arguments of axis. See Details and Examples.

...

Other arguments passed to the [graphics]{lines} function used to plot the grid lines.

Details

The mapproject function is used for projection.

axis.args should be a named list matching the arguments of axis. The exception is that xat and yat can be specified to induce different spacing of the ticks on the x and y axes. Thus, the at argument is ignored and replaced by xat and yat, as appropriate.

See Also

image, mapproject

Examples

1
2
3
4
5
6
7
8
data(narccap)
# plot image using mercator projection (w/o axes)
pimage(lon, lat, tasmax[,,1], proj = "mercator", axes = FALSE)
# add axes with grey grid lines, blue text, and custom spacing
paxes("mercator", xlim = range(lon), ylim = range(lat), 
      col = "grey", 
      axis.args = list(col.axis = "blue", 
                       xat = c(-160, -100, -90, -80, -20)))

jpfrench81/autoimage documentation built on March 17, 2021, 12:09 a.m.