Plot.DrawText

Prototypes

void DrawText( Matrix mX, Matrix mY, Matrix mText )

void DrawText( double dX, double dY, String sText )

void DrawText( double[] adX, double[] adY, String[] asText )

Parameters

Matrix mX, mY
Numeric vectors containing the X and Y coordinates of the anchor positions of the text strings. These coordinates are assumed to be in the current coordinate system.

Matrix mText
A character vector containing the text strings you want drawn. The string mText[i] will be drawn at the ordered pair (mX[i], mY[i]).

double dX, dY
An ordered pair specifying the anchor position of the text. These coordinates are assumed to be in the current coordinate system.

String sText
The text you want drawn.

double[] adX, adY
Numeric arrays containing the X and Y coordinates of the anchor positions of the text strings. These coordinates are assumed to be in the current coordinate system.

String[] asText
An array containing the text strings you want drawn.

Remarks

This method draws one or more text strings. The current text alignment and angle determine how a string is positioned relative to its anchor point. The string's anchor point is specified by (dX, dY) or (mX[i], mY[i]) or (adX[i], adY[i]). The string is drawn using the current text attributes as specified by the following methods:

Plot.DrawSetTextAlignment

Plot.DrawSetTextAngle

Plot.DrawSetTextColor

Plot.DrawSetTextSize

Plot.DrawSetTextStyle

Plot.DrawSetTextTypeface

You can break a text string into multiple lines by embedding newline characters (\n) in the string. For example:

"Line one\nLine two"J

The string will be split at each newline character and each substring will be drawn on a separate line using the current text alignment. Note that the J suffix after the closing double quotation mark informs IMLPlus that it should process the string for embedded special characters. Normally, IMLPlus treats text strings literally.

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.DrawText( 50, 50, "Center" );
plot.DrawSetTextAlignment( ALIGN_LEFT, -1 );
plot.DrawText( 75, 55, "Important\nObservation"J );