Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tisLegend

Add a legend to a tisPlot or scatterPlot


Description

The plotting functions tisPlot and scatterPlot leave an object named latestPlot in the frame from which they were called. tisLegend uses that object to set legend arguments (which you can override) and sets reasonable defaults for other arguments.

Usage

tisLegend(..., xrel = 0.1, yrel = 0.1, xjust = 0, yjust = 1, boxType ="n",
          ncol = 1, cex = 1)

Arguments

...

optional arguments to be passed on to legend. These can include x and y arguments to position the legend, or a list with components named x and y, such as the list returned by locator(1).

xrel, yrel

Optional numbers between 0 and 1 to specify placement relative to the boundaries of the plot.

xjust, yjust, ncol

passed along to legend

boxType

passed along as bty to legend

cex

gets multiplied by the cex from latestPlot and then passed on to legend

Details

This function is not strictly necessary, in that you could just call legend directly. tisLegend makes things a bit easier, however, by using the same argument names as tisPlot and scatterPlot to specify color, lineType, plotChar and boxType, rather than the less intuitive col, lty, pch and bty names. The xrel and yrel arguments provide an alternative way to specify legend placement, one that is used by the ChartMaker program.

Value

a list of the arguments that were sent on to legend, with class "tisLegend"

See Also


tis

Time Indexes and Time Indexed Series

v1.38
Unlimited
Authors
Jeff Hallman <jeffhallman@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.