Add a legend to an existing panel.
Arguments
- legend.loc
One of nine locations: bottomright, bottom, bottomleft, left, topleft, top, topright, right, or center.
- legend.names
Character vector of names for the legend. When
NULL, the column names of the current plot object are used.- col
Fill colors for the legend. When
NULL, the colorset of the current plot object data is used.- ncol
Number of columns for the legend.
- on
Panel number to draw on. A new panel will be drawn if
on = NA. The default,on = 0, will add to the active panel. The active panel is defined as the panel on which the most recent action was performed. Note that only the first element ofonis checked for the default behavior to add to the last active panel.- ...
Any other passthrough parameters to
legend().