ColorCodeObs

Prototype

void ColorCodeObs( DataObject dobj, String sVarName, Matrix mColors, Matrix mTotalNumColors )

Parameters

DataObject dobj
The DataObject containing the observations you want to color-code.

String sVarName
The name of the variable in the DataObject.

Matrix mColors
An n x 3 matrix of RGB colors. The first row represents the color to use for the smallest value of the variable, the last row represents the color for the largest value, and intermediate rows are used to construct the color blend.

Matrix mTotalNumColors
The total number of colors to include in the color blend.

Remarks

This module color-codes observations according to values of a single variable using a user-defined color blend. Observations with missing values for the requested variable are not colored. This module calls the BlendColors module.

Example
mData = { 1 7, 3 5, 4 5, 2 2, 2 4, 4 6, 4 8, 3 3, 1 4 };
declare DataObject dobj;
dobj = DataObject.Create( "Sample", {"X" "Y"}, mData );
mTotalColors = 7;
mColors = {   0   0 255,   /* blue = low values     */
              0 255   0,   /* green = medium values */
            255   0   0 }; /* red = high values     */
run ColorCodeObs( dobj, "Y", mColors, mTotalColors );
ScatterPlot.Create( dobj, "X", "Y" );
See Also

BlendColors