TEXTANN

Purpose:

Draws a left-justified block of text at a given point. The newer TEXT function includes more options.

Syntax:

TEXTANN(

x, y, target, fg, bg, font, box, legend, stretch, margin, focus, "s1", ..., "sN")

win

-

Optional. The target window. Defaults to the current window.

x, y

-

Real numbers that designate the upper left anchor coordinate pair for the text.

target

-

Optional. An integer specifying the spatial relationship of the text to the Window:

0:

PAPER (default). The text is located on the "graph paper" in the Window; within the coordinate system of the data. The text scrolls with the series.

1:

GLASS. The text is located within the plotting area of Window. The text remains fixed in place when the series scrolls.

2:

GLASS_WMARGIN. The text is located within the area of the entire Window. The text remains fixed in place when the series scrolls.

3:

GLASS_WPMARGIN. The text is located within the vertical dimensions of a Window, and within the horizontal dimensions of the plotting area. The text remains fixed in place when the series scrolls.

4:

GLASS_WSMARGIN. The text is located anywhere within the entire Worksheet area.

fg

-

Optional. An integer specifying the foreground color of the text. Defaults to 1, the color of the primary series.

bg

-

Optional. An integer specifying the background color of the text. Defaults to 1, the Window background color.

font

-

Optional. An integer specifying the font:

0:

NORM_FONT (default)

1:

SMALL_FONT

2:

STATLINE_FONT

3:

POPBOX_FONT

4:

WINLABEL_FONT

5:

TOOLBAR_FONT

6:

LISTBOX_FONT

7:

MENU_FONT

8:

USER1_FONT

9:

USER2_FONT

10:

USER3_FONT

11:

PANEL_FONT

box

-

Optional. An integer specifying presence or absence of a solid line box framing the text (with margin if legend is ON, otherwise, no margin). 1: ON; 0: OFF. Defaults to 1.

legend

-

Optional. An integer specifying whether legend symbols are present or absent. 1: ON; 0: OFF. Defaults to 0.

stretch

-

Optional. An integer specifying whether to stretch the annotation to fit the rectangular region where the text block resides. 1: ON; 0: OFF. Defaults to 0.

margin

-

Optional. An integer specifying the margin to be adjusted:

-1:

No Margin Adjustment (default)

0:

Top Margin

1:

Right Margin

2:

Bottom Margin

3:

Left Margin

focus

-

Optional. An integer specifying whether to stretch the annotation to fit the rectangular region where the text block resides. 1: ON; 0: OFF. Defaults to 0.

"s1", ... "sN"

-

One or more strings. Additional strings are optional and separated by commas. This is the text that will be printed at the specified x and y coordinates. Annotation lines are in top to bottom order.

Example:

grand(100,1)*10;textann(6.0, 3.0, 0, -1, 5, 1, 1, 0, "Temp over Time")

 

In this example, TEXTANN prints the text, Temp over Time at axis coordinates (6.0, 3.0) of the Window. The 0 as the target indicates that the text will scroll with the data (PAPER). The -1, 5 instruct DADiSP to use the color of the primary series and color 5 for the background. The text will be drawn using the small font (1), and it will be surrounded by a box.

 

W1: gsin(100,.01);setsymb(SQUARE,1,10,1)

W2: W1;overlay(gcos(100,.01),RED);setsymb(9,2,10,5)

addwf("textann(.1,.8,2,-1,-1,1,1,1,0,3,'Sine','Cosine')");pon

 

puts a legend in the left window margin.

Remarks:

In general, the newer TEXT function replaces TEXTANN.

 

All GLASS coordinates are normalized to the specified rectangular regions in the Worksheet, where the upper left corner is (0.0, 0.0) and the lower right corner is (1.0, 1.0). GLASS annotations "stick" to the Window like the viewfinder in a camera, while PAPER annotations scroll with the data.

 

To use TEXTANN from the command line, you must enclose a call to TEXTANN in a string passed to ADDWF manually, or append it to the current Window formula. This adds the command to the Window formula. You must then call PON to see the effect. Because it is a plottime function, TEXTANN is re-evaluated on every PON redraw.

 

The newer TEXT function eliminates the need for ADDWF.

 

To use the default value for any integer parameter (from target to focus), use -1 as the argument to TEXTANN.

 

If box is ON, then its background will be filled with the background color, and its edges will be drawn as solid lines in the foreground color.

 

If legend is ON, then the x,y parameters refer to the lower left corner of the first symbol in the legend block, not to the lower left corner of the first line in the text block. Each next line in the legend refers to the next overplot for color, line style, and symbols. Also, the interline spacing in legends is greater than in the no-legend-symbol case.

See Also:

ADDWFORM

TEXT

TEXTCUR

TEXTDEL

TEXTEDIT

TEXTMOVE