| maplim {GEOmap} | R Documentation |
Set reasonable map limits from a set of Lat-Lon pairs.
maplim(lat, lon, pct = 0.1)
lat |
vector of latitudes |
lon |
vector of longitudes |
pct |
percent fraction to increase (or decrease) limits |
In some (GEOmap) programs the longitude needs to be modulus 360, so these are provided also.
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 |
Jonathan M. Lees<jonathan.lees@unc.edu>
expandbound, plotGEOmapXY
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)