plotlegend: Add object specific legends to plots

View source: R/plotlegend.R

plotlegendR Documentation

Add object specific legends to plots

Description

Generic function to add a legend to a plot, allowing to for arguments given as simplists.

Usage

plotlegend(...)

## Default S3 method:
plotlegend(...)

Arguments

...

arguments specifying the graphic legend,

Details

Generic function for plotting legends, intended for use with objects that carry legend information. The default method is a wrapper for the base function legend, and allows to use simplists.

See Also

legend for the usual parameters.

Examples

# plot some curves
plot(cos, col = "red", to = pi, ylab = "y")
plot(sin, col = "green", to = pi, add = TRUE)
# use of simplists:
legendstuff <- simplist(legend = c("y = sin(x)", "y = cos(x)"), col = c("green", "red"))
plotlegend("bottomleft", legendstuff, lty = "solid")

plutils documentation built on Feb. 19, 2026, 3:01 a.m.