legJust: Add legend with right-justification

View source: R/plotting.R

legJustR Documentation

Add legend with right-justification

Description

Add legend with right-justification, functionalising Uwe Ligges' example in ?legend. Really a way of adding text automatically in the corner (which legend() works out the positioning for).

Usage

legJust(
  textVec,
  pos = "topright",
  textWidth = "slope=-*.**",
  inset = 0,
  logxy = FALSE
)

Arguments

textVec

text for the legend, one element for each row

pos

position of the legend (not tested for all positions)

textWidth

width to make the text

inset

inset distance

logxy

TRUE if axes are logarithmic

Value

Adds legend to exiting plot. Returns NULL.

Author(s)

Andrew Edwards

Examples

## Not run: 
 plot(10:1)
 legJust(c("Method", paste("value=", mean(1:10), sep=""), "x=7.0"))

## End(Not run)

andrew-edwards/sizeSpectra documentation built on June 28, 2023, 7:09 p.m.