Learn R Programming

geo (version 1.4-3)

geolegend: Put a legend on a plot in the geo series.

Description

Adds a legend to current plot. The location can be specified with \$lat and \$lon. Allows all the same parameters as legend.

Usage

geolegend(pos, legend, ...)

Arguments

pos
The position of the text, should include \$lat and \$lon. If \$lat and \$lon are llength 1, they determine the top left corner of the rectangle; if theey are length 2 vectors, the give opposite corners of the rectangular area. A list containing x and y values may be supplied.
legend
Vector of character strings to be associated with plot.
...
The function allows any optional argument to the legend function to be taken.

Value

None.

Side Effects

Draws a box at specified coordinates and puts inside (if possible) examples of lin, points, marks and/or shading, each identified with a user-specified text string.

Details

See legend.

See Also

legend.

Examples

Run this code
# The function is currently defined as
       function(pos, legend, ...)
       {
                      oldpar <- par()
                      par(geopar$gpar)
                      on.exit(par(oldpar))
                      xx <- Proj(pos$lat, pos$lon)
                      legend(xx$x, xx$y, legend = legend, ...)
       }

Run the code above in your browser using DataLab