Learn R Programming

oce (version 0.9-18)

mapText: Plot text on a existing map

Description

Plot text on an existing map

Usage

mapText(longitude, latitude, labels, ...)

Arguments

longitude
longitudes of text to be plotted
latitude
latitudes of text to be plotted
labels
labels of text to be plotted
...
optional arguments passed to text, e.g. adj, pos, etc.

Details

Adds text to an existing map, by analogy to text.

See Also

See mapPlot for general information on plotting maps, including other functions.

Examples

Run this code
library(oce)
data(coastlineWorld)
longitude <- coastlineWorld[['longitude']]
latitude <- coastlineWorld[['latitude']]
mapPlot(longitude, latitude, type='l', grid=5,
        longitudelim=c(-70,-50), latitudelim=c(45,50),
        projection="+proj=merc")
lon <- -63.5744 # Halifax
lat <- 44.6479
mapPoints(lon, lat, pch=20, col="red")
mapText(lon, lat, "Halifax", col="red", pos=1, offset=1)

Run the code above in your browser using DataLab