Plot.DrawPolygon

Prototypes

void DrawPolygon( Matrix mX, Matrix mY <, boolean bFill> )

void DrawPolygon( double[] adX, double[] adY <, boolean bFill> )

Parameters

Matrix mX
A numeric vector containing the horizontal coordinates of the vertices of the polygon. These coordinates are assumed to be in the current coordinate system.

Matrix mY
A numeric vector containing the vertical coordinates of the vertices of the polygon. These coordinates are assumed to be in the current coordinate system.

double[] adX
An array containing the horizontal coordinates of the vertices of the polygon. These coordinates are assumed to be in the current coordinate system.

double[] adY
An array containing the vertical coordinates of the vertices of the polygon. These coordinates are assumed to be in the current coordinate system.

boolean bFill
If bFill is true, the polygon is filled using the current brush characteristics. If bFill is false, the polygon is not filled. Calling this method without specifying the bFill parameter is equivalent to calling it with bFill equal to false.

Remarks

This method draws a polygon connecting the ordered pairs (mX[1], mY[1]), … (mX[n], mY[n]) where n is the number of elements in the vectors mX and mY (and similarly for the Java arrays). The polygon is drawn using the current drawing attributes. The outline of the polygon is drawn using the current pen characteristics. If the bFill parameter is true, the polygon is filled using the current brush characteristics.

Example
x = { 1 2 3 4 5 6 7 8 };
y = { 2 1 4 5 6 5 6 9 };
declare ScatterPlot plot;
plot = ScatterPlot.Create( "Sample Data", x, y );
plot.DrawUseDataCoordinates();
plot.DrawSetRegion( PLOTBACKGROUND );
plot.DrawSetBrushColor( 255, 0, 128 );
mX = { 2 6 5 6 2 };
mY = { 3 3 5 7 7 };
plot.DrawPolygon( mX, mY, true );
See Also

Plot.DrawPolygons