dot-addLegend: Add a Legend to a Plot

.addLegendR Documentation

Add a Legend to a Plot

Description

Internal function. Add a legend to a plot created by either ChemoSpec or ChemoSpec2D. ChemoSpec2D does not use symbols.

Usage

.addLegend(spectra, leg.loc, use.sym, ...)

Arguments

spectra

An object of S3 class ChemoSpec::Spectra() or ChemoSpec2D::Spectra2D().

leg.loc

Either a list with elements x and y, or a string like 'topright'. Values in a list should be on ⁠[0,1]⁠, i.e. the lower left of the plot area is ⁠0,0⁠ and the upper right is ⁠1,1⁠. Allowed string values are those described in graphics::legend() under 'Details'. A value of 'none' is acceptable as well.

use.sym

Logical; if true, the color scheme is set to black and the points plotted with symbols. Applies only to ChemoSpec.

...

Parameters to be passed to the plotting routines. Applies to base graphics only.

Value

None. Side effect is to modify an existing plot.

Author(s)

Bryan A. Hanson (DePauw University).


ChemoSpecUtils documentation built on May 29, 2024, 3:12 a.m.