labelArrow: Interactively place labels on a plot

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/labelArrow.R

Description

Interactively position labels and associated arrows on a plot and return code to reproduce the effect.

Usage

1
labelArrow(txt, pos = 3, ...)

Arguments

txt

The text of the label.

pos

the position of the label with respect to the end of the arrow: values of 1, 2, 3 and 4, mean left of, above and to the right. See text.

...

further graphical parameters.

Details

When the function is run, it calls locator to get the position of 2 mouse-clicks on the graphics window. The first determines the position of the label and the arrow tail, the second the position of the arrow head.

Code to reproduce the label and arrow is displayed in the Console; this can be cut-pasted into a script for future use.

Value

Returns invisibly a list with the coordinates of the two points selected.

Author(s)

Mike Meredith

See Also

locator.

Examples

1
2
3
4
5
## Not run: 
plot(Volume ~ Girth, data=trees)
labelArrow("Largest tree")

## End(Not run)

mikemeredith/MMmisc documentation built on Nov. 8, 2019, 11:34 p.m.