maplim: Map Limits

View source: R/maplim.R

maplimR Documentation

Map Limits

Description

Set reasonable map limits from a set of Lat-Lon pairs.

Usage

maplim(lat, lon, pct = 0.1)

Arguments

lat

vector of latitudes

lon

vector of longitudes

pct

percent fraction to increase (or decrease) limits

Details

In some (GEOmap) programs the longitude needs to be modulus 360, so these are provided also.

Value

list of range of lats and lons

lat

lat limits

lon

lat limits

LON

lon limits modulus 360

lim

vector: lon1 lat1 lon2 lat2

LIM

vector: lon1 lat1 lon2 lat2, with lon limits modulus 360

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

expandbound, plotGEOmapXY

Examples


lat = rnorm(10, m=46, sd=2)
lon = rnorm(10, m=-121, sd=1)

M = maplim(lat, lon, pct=.2)

plot(M$lon, M$lat, type='n')
points(lon, lat)

############   plotting with a GEOmap
library(geomapdata)
data(worldmap)

PROJ = setPROJ(type=2, LON0=mean(lon), LAT0=mean(lat))

plotGEOmapXY(worldmap, LIM=M$LIM)
pointsGEOmapXY(lat, lon,PROJ =PROJ,  pch=6)





GEOmap documentation built on Sept. 1, 2023, 5:09 p.m.