Learn R Programming

ChemoSpecUtils (version 1.0.5)

.ggAddLegend: Add Legend to a ggplot2 Plot

Description

Internal function. This function creates a suitable legend and returns it as a set of grobs, ready to be added to an existing plot.

Usage

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

Value

A grob containing the legend.

Arguments

spectra

An object of S3 class ChemoSpec::Spectra().

use.sym

Logical specifying if symbols will be used or not.

leg.loc

A list giving x, y coordinates, and a reference point.

Author

Bryan A. Hanson (DePauw University), Tejasvi Gupta.