Add Text to a Map

Description

Plot text on an existing map.

Usage

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

Arguments

longitude

vector of longitudes of text to be plotted.

latitude

vector of latitudes of text to be plotted.

labels

vector of 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.

Author(s)

Dan Kelley

See Also

A map must first have been created with mapPlot.

Other functions related to maps: lonlat2map, lonlat2utm, map2lonlat, mapArrows, mapAxis, mapContour, mapDirectionField, mapGrid, mapImage, mapLines, mapLocator, mapLongitudeLatitudeXY, mapPlot, mapPoints, mapPolygon, mapScalebar, mapTissot, oceCRS, shiftLongitude, utm2lonlat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
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)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.