Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mapasp

Calculate aspect ratio for plotting geographic maps; create nice degree axis labels


Description

Calculate aspect ratio for plotting geographic maps; create nice degree axis labels

Usage

mapasp(data, xlim, ylim)
degreeLabelsEW(x)
degreeLabelsNS(x)

Arguments

data

object of class or extending Spatial

xlim

the xlim argument passed (or derived from bounding box)

ylim

the ylim argument passed (or derived from bounding box)

x

numeric; values at which tics and marks will be generated

Value

mapasp is used for the aspect argument in lattice plots and spplot;

let x = dy/dx, with dy and dx the y- and x-size of the map.

let s = 1/cos((My * pi)/180) with My the y coordinate of the middle of the map (the mean of ylim)

for latlong (longlat) data, mapasp returns s * x. for other data, mapasp returns "iso".

Note

the values for x are typically obtained from axTicks

See Also

levelplot in package lattice


sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.