| plotlegend | R Documentation |
Generic function to add a legend to a plot, allowing to for arguments given as simplists.
plotlegend(...)
## Default S3 method:
plotlegend(...)
... |
arguments specifying the graphic legend, |
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.
legend for the usual parameters.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.