ptext {autoimage} | R Documentation |
Projected text function
Description
ptext
draws the character strings given in labels
at
the provided coordinates, possibly after projection.
Usage
ptext(x, y = NULL, labels, proj, ...)
Arguments
x |
numeric vectors of coordinates where the text
|
y |
numeric vectors of coordinates where the text
|
labels |
a character vector or expression specifying
the text to be written. An attempt is made to coerce other
language objects (names and calls) to expressions, and vectors and
other classed objects to character vectors by |
proj |
A character string indicating what projection should be
used for the included |
... |
further graphical parameters (from |
Details
The mapproject
function is used for
projection.
A non-character labels
argument is automatically converted
to a character
vector using link[base]{as.character}
.
See Also
Examples
data(narccap)
# plot image using bonne projection (w/o grid lines)
pimage(lon, lat, tasmax[,,1], proj = "bonne",
parameters = 40, paxes.args = list(grid = FALSE))
# get national boundaries
data(worldMapEnv, package = "maps")
worldpoly <- maps::map("world", plot = FALSE)
plines(worldpoly, proj = "bonne")
# add U.S. city names to existing plot
data(us.cities, package = "maps")
citysmall <- head(us.cities)
ptext(x = citysmall$lon, y = citysmall$lat,
labels = citysmall$name, proj = "bonne")