DataObject.SetMarkerColor

Prototypes

void SetMarkerColor( <Matrix mObsNumbers,> int nColor )

void SetMarkerColor( <Matrix mObsNumbers,> int nRed, int nGreen, int nBlue )

void SetMarkerColor( Matrix mObsNumbers, Matrix mRGB )

void SetMarkerColor( Matrix mObsNumbers, Matrix mRed, Matrix mGreen, Matrix mBlue )

Parameters

int nColor
A predefined constant specifying the desired color. The valid values 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.

int nRed, nGreen, nBlue
An RGB specification of the desired color. Each parameter must be an integer in the range [0, 255]. Examples: the triplet (0, 0, 0) represents black; the triplet (255, 255, 255) represents white.

Matrix mObsNumbers
A vector containing the observation numbers (1-based) of the observations whose marker color you want to change. To specify all the observation numbers in the DataObject, use the predefined constant OBS_ALL.

Matrix mRGB
This parameter must be either a scalar, a vector, or a 3-column matrix. If mRGB is a scalar, it is a predefined constant specifying the desired color for all the specified observations. If mRGB is a vector, mRGB[i] is a predefined constant specifying the desired color for observation mObsNumbers[i]. If mRGB is a 3-column matrix, row i specifies the color for observation mObsNumbers[i]. Column 1 specifies the color's red component (0–255), column 2 specifies the color's green component (0–255), and column 3 specifies the color's blue component (0–255).

Matrix mRed, mGreen, mBlue
Vectors that specify color components. For observation mObsNumbers[i], mRed[i] specifies the color's red component (0–255), mGreen[i] specifies the color's green component (0–255), and mBlue[i] specifies the color's blue component (0–255).

Remarks

This method sets the color (both the fill color and the outline color) of the marker used to represent an observation in a plot. If you call this method without specifying the mObsNumbers parameter, it operates on the selected observations.

This method supports a special predefined constant called NOCOLOR. If you use the NOCOLOR constant in place of one of the normal color constants, the specified observations' markers will become invisible.

Instead of using one of the predefined color constants, you can specify a color as a hexadecimal value of the form 00rrggbbX, where rr specifies the color's red component (00–FF hexadecimal), gg specifies the color's green component (00–FF hexadecimal), and bb specifies the color's blue component (00–FF hexadecimal). The predefined color constants are themselves values of this form.

Although the method SetMarkerColor is defined in the DataObject class, you can also call it from the Plot class or any of the classes derived from the Plot class. This capability is provided for convenience.

Example
x = { 1, 2, 3, 4, 5, 6, 7, 8 };
y = { 2, 4, 8, 16, 32, 64, 128, 256 };
declare ScatterPlot plot;
plot = ScatterPlot.Create( "Sample Data", x, y );
mObs = { 4 5 };
plot.SetMarkerColor( mObs, RED );
See Also

DataObject.SetMarkerFillColor
DataObject.SetMarkerOutlineColor