Plot.DrawPolygons

Prototypes

void DrawPolygons( Matrix mX, Matrix mY, Matrix mNumVertices, Matrix mColors <, boolean bFill> )

void DrawPolygons( double[] adX, double[] adY, int[] anNumVertices, int[] anColors <, boolean bFill> )

Parameters

Matrix mX
A numeric vector containing the horizontal coordinates of the vertices of the polygons. All the coordinates for a polygon must be contiguous in the vector. The coordinates are assumed to be in the current coordinate system.

Matrix mY
A numeric vector containing the vertical coordinates of the vertices of the polygons. All the coordinates for a polygon must be contiguous in the vector. The coordinates are assumed to be in the current coordinate system.

Matrix mNumVertices
A numeric vector specifying the number of vertices in each polygon. Polygon i contains mNumVertices[i] vertices.

Matrix mColors
A numeric vector specifying the color of each polygon. The color of polygon i is mColors[i]. See Remarks for details on how the colors are used.

double[] adX
An array containing the horizontal coordinates of the vertices of the polygons. All the coordinates for a polygon must be contiguous in the array. The coordinates are assumed to be in the current coordinate system.

double[] adY
An array containing the vertical coordinates of the vertices of the polygons. All the coordinates for a polygon must be contiguous in the array. The coordinates are assumed to be in the current coordinate system.

int[] anNumVertices
An array specifying the number of vertices in each polygon. Polygon i contains anNumVertices[i] vertices.

int[] anColors
An array specifying the color of each polygon. The color of polygon i is anColors[i]. See Remarks for details on how the colors are used.

boolean bFill
If bFill is true, polygon i is filled with color mColors[i] (or anColors[i]) using the current brush style. If bFill is false, the polygons are not filled. Calling this method without specifying the bFill parameter is equivalent to calling it with bFill equal to false.

Remarks

This method draws N polygons. The first mNumVertices[1] elements of mX and mY (or anNumVertices[1] of adX and adY) determine the first polygon. The next mNumVertices[2] elements determine the second polygon, and so on. Thus, the number of elements in mX and mY must equal the sum of the elements of mNumVertices.

Each value in the mColors vector (or the anColors array) is interpreted as an integer color value whose hexadecimal representation is in 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). IMLPlus provides the following predefined color constants: 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, YELLOW.

If bFill is false, the outline of polygon i is drawn in color mColors[i] (or anColors[i]) using the current pen style and width. If bFill is true, polygon i is filled with color mColors[i] (or anColors[i]) using the current brush style. If bFill is true, the current pen is not used.

Example
x = { 0, 1, 1, 0,    1.5, 2, 1,   1.5, 2,  1 };
y = { 0, 0, 1, 1,    1,   2, 2,   0,  -1, -1 };
numVerts = { 4, 3, 3 };
colors = RED // GREEN // BLUE;
 
declare ScatterPlot plot;
plot = ScatterPlot.Create( "polytest", -1:4, -1:4 );
plot.DrawUseDataCoordinates();
plot.DrawPolygons( x, y, numVerts, colors );
See Also

Plot.DrawPolygon