Internal functions and data objects to make graphs easier to read, and better for print and presentation.
legend(
x,
y = NULL,
legend,
fill = NULL,
col = par("col"),
lty,
lwd,
pch,
angle = 45,
density = NULL,
bty = "o",
bg = par("bg"),
pt.bg = NA,
cex = 1,
pt.cex = cex,
pt.lwd = lwd,
xjust = 0,
yjust = 1,
x.intersp = 1,
y.intersp = 1,
adj = c(0, 0.5),
text.width = NULL,
text.col = par("col"),
merge = do.lines && has.pch,
trace = FALSE,
plot = TRUE,
ncol = 1,
horiz = FALSE,
title = NULL,
inset = 0,
border.col = NULL,
border.lwd = 1,
border.lty = "solid",
box.col = NULL,
box.lwd = 1,
box.lty = "solid",
...
)
the x and y co-ordinates to be used to position the legend. They
can be specified by keyword or in any way which is accepted by
xy.coords
: See Details.
a character or expression vector. of length \(\ge 1\) to appear in the legend.
if specified, this argument will cause boxes filled with the specified colors (or shaded in the specified colors) to appear beside the legend text.
the color of points or lines appearing in the legend.
the line types and widths for lines appearing in the legend. One of these two must be specified for line drawing.
the plotting symbols appearing in the legend, either as vector of 1-character strings, or one (multi character) string. Must be specified for symbol drawing.
angle of shading lines.
the density of shading lines, if numeric and positive. If
NULL
or negative or NA
color filling is assumed.
the type of box to be drawn around the legend. The allowed
values are "o"
(the default) and "n"
.
the background color for the legend box. (Note that this is only
used if bty != "n"
.)
the background color for the points
,
corresponding to its argument bg
.
character expansion factor relative to current
par("cex")
.
expansion factor(s) for the points.
line width for the points, defaults to the one for lines, or
if that is not set, to par("lwd")
.
how the legend is to be justified relative to the legend x location. A value of 0 means left justified, 0.5 means centered and 1 means right justified.
the same as xjust
for the legend y location.
character interspacing factor for horizontal (x) spacing.
the same for vertical (y) line distances.
numeric of length 1 or 2; the string adjustment for legend text.
Useful for y-adjustment when labels
are plotmath expressions.
the width of the legend text in x ("user"
)
coordinates. (Should be positive even for a reversed x axis.) Defaults to
the proper value computed by strwidth(legend)
.
the color used for the legend text.
logical; if TRUE
, “merge” points and lines but
not filled boxes. Defaults to TRUE
if there are points and lines.
logical; if TRUE
, shows how legend
does all its
magical computations.
logical. If FALSE
, nothing is plotted but the sizes are
returned.
the number of columns in which to set the legend items (default is 1, a vertical legend).
logical; if TRUE
, set the legend horizontally rather
than vertically (specifying horiz
overrides the ncol
specification).
a character string or length-one expression giving a title to be placed at the top of the legend.
inset distance(s) from the margins as a fraction of the plot region when legend is placed by keyword.
the color, line type and width for the legend border.
the color, line type and width for the legend box.
any other passthrough parameters
Also contains common economic cycle dates and dates of serious market events per asset class.
All items ending in .labels or .dates contain labels or dates that would be appropriate for specific asset classes or economic cycles.
legend
is a wrapper function for legend
to
better handle placement and formatting of a legend for the charts
all objects ending in symbol are symbol sets for line charts.