Plot.DrawPath

Prototypes

void DrawPath( Matrix mX, Matrix mY, Matrix mWidths, Matrix mColors <, boolean bFill> )

void DrawPath( double[] adX, double[] adY, int[] anWidths, int[] anColors <, boolean bFill> )

Parameters

Matrix mX
A numeric vector containing the horizontal coordinates of the vertices of the center of the path. 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 center of the path. The coordinates are assumed to be in the current coordinate system.

Matrix mWidths
A numeric vector specifying the width of the path at each vertex. The widths are specified in units of screen pixels. See Remarks for details on how the widths are used.

Matrix mColors
A numeric vector specifying the color of each line segment of the path. See Remarks for details on how the colors are used.

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

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

int[] anWidths
An array specifying the width of the path at each vertex. The widths are specified in units of screen pixels. See Remarks for details on how the widths are used.

int[] anColors
An array specifying the color of each line segment of the path. See Remarks for details on how the colors are used.

boolean bFill
If bFill is true, the ith line segment is filled with color mColors[i] (or anColors[i]) using the current brush style. If bFill is false, the path 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 path. A path is a generalization of a polyline. A path is defined by ordered pairs that determine the center of the path, an array of widths that determines the width of the path at each vertex, and an array of colors that determines the color of each line segment. Because the number of line segments is one less than the number of vertices, the number of elements in the mColors matrix (or the anColors array) must be one less than the number of vertices.

Each value in the mWidths vector (or the anWidths array) may be either positive or negative. If the signs of the widths at both ends of a line segment are the same, the boundary of the path for that segment will not intersect itself. If the signs are different, the boundary of the path will intersect itself.

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 the path is drawn using the current pen style and width. If bFill is true, the path is filled using the current brush style. If bFill is true, the current pen is not used.

Example
TWOPI = 6.2831853;
t = T( do(0,TWOPI,TWOPI/64) );
x = cos(t);
y = sin(2*t);
thickness = 20*cos(t/2);
colormap=IntToRGB(RED//YELLOW//GREEN//BLUE//MAGENTA//RED);
colors = RGBToInt(BlendColors( colormap, 64 ));
 
declare ScatterPlot plot;
plot = ScatterPlot.Create( "DrawPath", {-2 2}, {-2 2} );
plot.DrawUseDataCoordinates();
plot.DrawPath( x, y, thickness, colors, true );
See Also

Plot.DrawLine