plotlegend: Add object specific legends to plots

Description Usage Arguments Details See Also Examples

View source: R/plotlegend.R

Description

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

Usage

1
2
3
4
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

1
2
3
4
5
6
# 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 May 2, 2019, 5:53 p.m.