defaultStrucLegend {stripless} | R Documentation |
Default legend function for strucplot
displays.
Description
A structure legend is always printed on the console. It can also be optionally added to the trellis plot. This function constructs a default legend for this option.
Usage
defaultStrucLegend(struc, legendLoc = c("top", "right", "bottom", "left",
"newpage"), legendLab = NA, heading = c("Horizontal", "Vertical"),
miss = "No Conditioning", abbrevLength = c(0, 0), cex.font = 1,
cex.lab = 1.25, col = "black", ...)
Arguments
struc |
The "structure" attribute of a |
legendLoc |
One of c("top","right","bottom","left","newpage") The first 4 specify on which side of the trellis display to place the legend. The last indicates that the legend will be plotted at the center of a separate page. |
legendLab |
A character string title for the legend. A value of
|
heading |
A character vector of length 2 giving the headings for the horizontal
and vertical conditioning variables portions of the legend. Default =
|
miss |
A character string to use when there is no conditioning either horizontally
or vertically. Default = |
abbrevLength |
Default = |
cex.font |
Multiplier for text font size in a trellis legend. Default = 1. |
cex.lab |
Multiplier for legend title font size in a trellis legend. Default = 1.25. |
col |
Text color for text in a trellis legend. Default = |
... |
Additional arguments to be used in a |
Value
A text grob that can be included as part of the strucplot
trellis plot.
See Also
Examples
# Controlling the console and plot legends
library(datasets) ## for the barley data
#
out <- strucplot(variety~yield|year*site,data=barley, horizontal=TRUE,
panel=panel.dotplot, col = "darkblue",
scales = list(alternat = 1, y = list(cex=.5)),
spacings = list(x=0, y=.5))
#
# Default with legend on top; note that no title is the plot legend default
print(out, legendLoc = "t", abbrev= list(site = c(0,4)))
#
# Include title on plot and reduce default font sizes in red text
print(out, legendLoc = "T", abbrev = list(site = c(0,6)),
legendLab = "Structure", cex.lab = 1, cex.font = .75, col = "darkred" )