Learn R Programming

GEOmap (version 2.1)

sizelegend: Magnitude size legend

Description

Plot a simple legend of magnitude sizes at the top of a plot.

Usage

sizelegend(se, am, pch = pch)

Arguments

se
vector, sizes
am
vector, labels
pch
plotting character

Value

  • Graphical Side Effect

Details

A box around the legend is currently introduced.

Examples

Run this code
x = rnorm(30)
y = rnorm(30)

mags = runif(30, 1,8)


plot(x, y, type="n")

esiz = exp(mags)
rsiz = RESCALE(esiz, .4, 10, min(esiz), max(esiz))
points(x, y, pch=1, cex=rsiz)

am = pretty(mags)
am = am[am>min(mags) & am<max(mags) ]

em = exp(am)
se = RESCALE(em, .4, 10, min(esiz), max(esiz))

sizelegend(se, am, pch=1)

Run the code above in your browser using DataLab