The features described in this topic are obsolete
and should not be used in new IDL code.

LIVE_TEXT

The LIVE_TEXT procedure is an interface for text annotation. You can control your LIVE window after it is created using any of several auxiliary routines. See LIVE_Tools for an explanation.

Syntax

LIVE_TEXT[, Text] [, ALIGNMENT=value{0.0 to 1.0}] [, COLOR='color name' ] [, /DIALOG] [, /ENABLE_FORMATTING] [, ERROR=variable] [, FONTNAME=string] [, FONTSIZE=points{9 to 72}] [, /HIDE] [, LOCATION=[x, y]] [, NAME=string] [, /NO_DRAW] [, /NO_SELECTION] [, REFERENCE_OUT=variable] [, TEXTANGLE=value{0.0 to 360.0}] [, VERTICAL_ALIGNMENT=value{0.0 to 1.0}] [, VISUALIZATION_IN=string] [, WINDOW_IN=string]

Arguments

Text

The string to be used for the text annotation. The default is "Text". If Text is an array of strings, each element of the string array will appear on a separate line.

Keywords

ALIGNMENT

Set this keyword to a floating-point value between 0.0 and 1.0 to indicate the horizontal alignment of the text. The alignment scheme is as follows:

1.0----  -----0.5-----  ---0.0

Left         Middle        Right

COLOR

Set this keyword to a string (case-sensitive) of the foreground color to be used for the text. The default is `Black'. The following colors are available:

  • Black
  • Red
  • Green
  • Yellow
  • Blue
  • Magenta
  • Cyan
  • Dark Gray
  • Light Gray
  • Brown
  • Light Red
  • Light Green
  • Light Blue
  • Light Cyan
  • Light Magenta
  • White

DIALOG

Set this keyword to have the text annotation dialog appear. This dialog will fill in known attributes from set keywords.

ENABLE_FORMATTING

Set this keyword to have LIVE_TEXT interpret "!" (exclamation mark) as font and positioning commands.

ERROR

Set this keyword to a named variable to contain the returned error message (string). An empty string is returned if no errors occurred during the operation. By default, errors are reported via a GUI.

Note
If a named variable is passed in this keyword and an error occurs, the error GUI will not be displayed.

FONTNAME

Set this keyword to a string containing the name of the desired font. The default is Helvetica.

FONTSIZE

Set this keyword to an integer scalar specifying the font point size to be used. The default is 12. Available point sizes are 9 through 72.

HIDE

Set this keyword to a boolean value indicating whether this item should be drawn:

LOCATION

Set this keyword to a two-element, floating-point vector of the form [X, Y] specifying the location of the visualization (relative to the lower left hand corner within the visualization window) in normalized coordinates. The default is [0.5, 0.5].

Note
LOCATION may be adjusted to take into account window decorations.

NAME

Set this keyword equal to a string containing the name to be associated with this item. The name must be unique within the given window or buffer (WINDOW_IN). If not specified, a unique name will be assigned automatically.

NO_DRAW

Set this keyword to inhibit the visualization window from drawing. This is useful if multiple visualizations and/or annotations are being created via calls to other LIVE_Tools in order to reduce unwanted draws and help speed the display.

REFERENCE_OUT

Set this keyword to a variable to return a structure defining the names of the created items. The fields of the structure are shown in the following table:

Table 2-38: Fields of the LIVE_TEXT Reference Structure

Tag
Description

WIN

Window Name

VIS

Visualization Name

GRAPHIC

Graphic Name the text created

TEXTANGLE

Set this keyword to a floating-point value defining the angle of rotation of the text. The valid range is from 0.0 to 360.0. The default is 0.0.

VERTICAL_ALIGNMENT

Set this keyword to a floating-point value between 0.0 and 1.0 to indicate the vertical alignment of the text baseline. The alignment scheme is as follows:

0.0      Top
.
0.5      Middle
.
1.0      Bottom

VISUALIZATION_IN

Set this keyword equal to the name (string, case-insensitive) of a LIVE tool visualization. The VIS field from the REFERENCE_OUT keyword from the creation of the LIVE tool will provide the visualization name. If only one visualization is present in the window or buffer (WINDOW_IN), this keyword will default to it.

WINDOW_IN

Set this keyword equal to a name (string, case-sensitive) of a LIVE tool window or a LIVE tool buffer. The WIN tag of the REFERENCE_OUT structure from the creation of the LIVE tool will provide the window or buffer name. Window names are also visible in visualization window titlebars. If only one LIVE tool window (or buffer) is present in the IDL session, this keyword will default to it.

Examples

LIVE_TEXT, 'My Annotation', WINDOW_IN='Live Plot 2', $ 
   VISUALIZATION_IN='line plot visualization' 

Version History

Introduced: 5.1

See Also

LIVE_LINE, LIVE_RECT