legend.box: Define location of a legend box.

View source: R/legend.box.R

legend.boxR Documentation

Define location of a legend box.

Description

Define a location of a legend box. Used by legend.bubble and legend.pie. This is not intended as a user function.

Usage

legend.box(x, y = NULL, maxradius, mab = 1.2, inset = 0, double = F)

Arguments

x, y

the x and y co-ordinates to be used to position the legend, see legend.

maxradius

the (maximum) radius of the pie or bubble to be represented in the legend.

mab

the margin around the bubble or pie.

inset

inset distance(s) from the margins as a fraction of the plot region when legend is placed by keyword.

double

logical, should the box be double the 'normal' size to allow for pies and bubbles to be displayed in a single legend box. generally not very pretty.

Value

Returns the corner points of the legend box in user coordinates

Author(s)

Hans Gerritsen

See Also

legend.bubble, legend.pie

Examples

plot(1)
box <- legend.box("topleft", maxradius=0.2, inset=0.02)
rect(box[1],box[2],box[3],box[4], border="red", lwd=3, lty=2)
legend.bubble("topleft", z=10, maxradius=0.2, inset=0.02)

mapplots documentation built on Aug. 25, 2023, 5:15 p.m.