void DrawLegendEx( Plot plot, Matrix mLabels, int nLabelSize, Matrix mLineColor, Matrix mLineStyle, Matrix mSymbol, int nBackgroundColor, Matrix mLocXY, int nNumCols, String sTitle, String sLocTitle, boolean bDrawBox )
Plot plot
The plot to which the legend will be added.
Matrix mLabels
A character vector that specifies the labels for the items in the legend. The string mLabels[i] is the label for the ith item.
int nLabelSize
The point size (units of 1/72 inch) of the font used for the legend labels.
Matrix mLineColor
A numeric vector containing colors (as integers). The value mLineColor[i] is the color for the ith line or rectangle in the legend (see below). If mLineColor
is a scalar, its value is used for all items. The predefined color constants are BLACK, BLUE, BROWN, CHARCOAL, CREAM, CYAN, GOLD, GRAY,
GREY, GREEN, LILAC, LIME, MAGENTA, MAROON, OLIVE, ORANGE, PINK, PURPLE, RED, ROSE, SALMON, STEEL,
TAN, VIOLET, WHITE, and YELLOW.
Matrix mLineStyle
A numeric vector in which the ith element specifies the line style for the ith line or rectangle in the legend. The valid line styles are SOLID, DASHED,
DOTTED, DASHDOT, and DASHDOTDOT. If mLineStyle[i] is 0, a rectangle is drawn for the ith item instead of a line segment. If mLineStyle[i]
is negative, neither a line segment nor a rectangle is drawn for the ith item. If mLineStyle is a scalar, its value is used for all items.
Matrix mSymbol
A numeric vector in which the ith element specifies the symbol for the ith item in the legend. The valid symbols are MARKER_SQUARE, MARKER_PLUS, MARKER_CIRCLE,
MARKER_DIAMOND, MARKER_X, MARKER_TRIANGLE, MARKER_INVTRIANGLE, and MARKER_STAR. If mSymbol[i] is -1, no symbol is drawn for the ith
item. If mSymbol is a scalar, its value is used for all items.
int nBackgroundColor
The background color of the legend. The predefined color constants are BLACK, BLUE, BROWN, CHARCOAL, CREAM, CYAN, GOLD, GRAY, GREY,
GREEN, LILAC, LIME, MAGENTA, MAROON, OLIVE, ORANGE, PINK, PURPLE, RED, ROSE, SALMON, STEEL, TAN,
VIOLET, WHITE, and YELLOW. If nBackgroundColor is -1, the legend will be transparent.
Matrix mLocXY
A numeric vector that specifies the position of the upper-left corner of the legend within the Graph Area. The lower-left corner of the Graph Area corresponds to (0,0) and the upper-right corner
of the Graph Area corresponds to (100,100).
int nNumCols
The number of columns into which the legend should be arranged.
String sTitle
The title of the legend.
String sLocTitle
A three-character text string that specifies the position of the title within the legend box. This string has the form "PXY", where P is either I (inside the legend) or O
(outside the legend), X is either L (left), C (center), or R (right), and Y is either T (top), C (center), or B (bottom). For example, common choices are "OCT" (centered
above the legend box) and "ILC" (inside the legend box and to the left of all items).
boolean bDrawBox
If bDrawBox is true, a box is drawn around the legend. If bDrawBox is false, a box is not drawn around the legend.
This module is an extended version of the DrawLegend module.
This module draws a legend on a plot. The number of labels and the values of the nLabelSize and nNumCols parameters determine the size of the legend.
This module never modifies the Graph Area margins. If you position the legend outside the Plot Area, you may want to modify the Graph Area margins yourself.
declare DataObject dobj; dobj = DataObject.CreateFromFile( "iris" ); dobj.GetVarData( "Species", species ); speciesName = { "Setosa", "Virginica", "Versicolor" }; speciesColor = RED || GREEN || BLUE; do i = 1 to 3; obs = loc( species = speciesName[i] ); dobj.SetMarkerFillColor( obs, speciesColor[i] ); end; declare ScatterPlot plot; plot = ScatterPlot.Create( dobj, "PetalLen", "PetalWid" ); plot.SetMarkerSize( 5 ); run DrawLegendEx( plot, speciesName, 8, speciesColor, -1, MARKER_SQUARE, -1, {35 38}, 3, "Iris Species", "ICT", true );