Learn R Programming

oce (version 0.9-5)

mapPlot: Plot a map

Description

Plot a map

Usage

mapPlot(longitude, latitude, longitudelim, latitudelim, grid,
       projection="mercator", parameters=NULL, orientation=NULL,
       ...)

Arguments

longitude
longitudes of points to be plotted, or a coastline object from which longitude and latitude are to be taken (see e.g. read.coastline).
latitude
latitudes of points to be plotted
longitudelim
optional limit of longitudes to plot
latitudelim
optional limit of latitudes to plot
grid
if TRUE, draw an auto-scaled lat-lon grid; if a number, draw a grid with the indicated spacing, in degrees.
projection
projection; see mapproject.
parameters
parameters for projection; see mapproject.
orientation
orientation for projection; see mapproject.
...
optional arguments passed to plotting functions.

Details

Creates a map using the indicated projection.

References

Snyder, John P., 1987. Map Projections: A Working Manual. USGS Professional Paper: 1395 (available at pubs.usgs.gov/pp/1395/report.pdf).

See Also

Points may be added to a map with mapPoints, lines may be added with mapLines, and text with mapText.

Examples

Run this code
library(oce)
data(coastlineWorld)
longitude <- coastlineWorld[['longitude']]
latitude <- coastlineWorld[['latitude']]
mapPlot(longitude, latitude, type='l',
        latitudelim=c(0,120), longitudelim=c(-80,10),
        grid=10,
        projection="orthographic", orientation=c(45,-100,0))

## Illustrate the Lambert conformal conic projection,
## said by Snyder (page 34) to be suitable for regions
## of large east-west extent away from the equator.
## Here, show USA and Canada.
mapPlot(coastlineWorld, type='l',
        latitudelim=c(30,60), longitudelim=c(-130,-50),
        proj="lambert",
        parameters=c(lat0=40,lat1=60),
        orientation=c(90,-90,0), grid=TRUE)

## Similar looking map, with the polyconic projection
mapPlot(coastlineWorld, type='l',
        latitudelim=c(30,60), longitudelim=c(-130,-50),
        proj="polyconic", orientation=c(90, -90,0), grid=TRUE)

Run the code above in your browser using DataLab