DrawInset

Prototype

void DrawInset( Plot plot, Matrix mLabels, Matrix mValues, Matrix mLabelProps, Matrix mLabelTypeface, int nBackgroundColor, String sLocation )

Parameters

Plot plot
The plot to which the inset will be added.

Matrix mLabels
A character vector that specifies the labels (left-hand column) for the items in the inset. The string mLabels[i] is the label for the ith item.

Matrix mValues
A numeric or character vector that specifies the values (right-hand column) for the items in the inset. The element mValues[i] is the value for the ith item.

Matrix mLabelProps
A numeric vector of length 5 that specifies the properties for the inset items. If the ith element is missing, a default value is used for the corresponding property.

mLabeProps[1] specifies the point size (units of 1/72 inch) of text. The default is 8.

mLabeProps[2] specifies the color (as an integer) of text. The default is BLACK. 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.

mLabeProps[3] specifies the font style of text. The default is STYLE_REGULAR. The valid values are STYLE_REGULAR, STYLE_BOLD, STYLE_ITALIC, and STYLE_BOLDITALIC.

mLabeProps[4] specifies the horizontal alignment for labels (left-hand column). The default is ALIGN_LEFT. The valid values are ALIGN_LEFT, ALIGN_CENTER, and ALIGN_RIGHT.

mLabeProps[5] specifies the horizontal alignment for values (right-hand column). The default is ALIGN_RIGHT. The valid values are ALIGN_LEFT, ALIGN_CENTER, and ALIGN_RIGHT.

Matrix mLabelTypeface
A character matrix containing the name of the typeface to be used for labels and values. The following typefaces are available on all Windows systems: Arial, Courier New, Symbol, Times New Roman, and Wingdings.

int nBackgroundColor
The background color of the inset. 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 inset will be transparent.

String sLocation
A three-character text string that specifies the position of the legend within the plot. This string has the form "PXY", where P is either I (inside the Plot Area) or O (outside the Plot Area), 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 "ILT" (upper left corner of the Plot Area), "ORC" (in the right graph margin), and "OCB" (in the bottom graph margin).

Remarks

This module draws an inset on a plot. An inset is a two-column table. The number of labels and the size of the text determine the size of the inset.

If the inset is positioned outside the Plot Area (for example, sLocation = "ORC"), the Graph Area margins are modified to accommodate the inset.

If mLabeProps is an empty matrix, default values are used. If mLabelTypeface is an empty matrix or contains the empty string, a default typeface is used.

Example
x = T(1:10);
y = {3,4,3,5,6,5,8,9,8,9};
declare ScatterPlot plot;
plot = ScatterPlot.Create("Sample", x, y);
LabelProps = j(5,1,.);
LabelProps[1]=12;
run DrawInset( plot, {"Corr" "NObs"}, {0.9342 10},
      LabelProps, "Arial", -1, "ORC" );
See Also

DrawLegend