Language Reference

GTEXT and GVTEXT Calls

place text horizontally or vertically on a graph

CALL GTEXT( x, y, text<, color<, window<, viewport>);
CALL GVTEXT( x, y, text<, color<, window<, viewport>);

The inputs to the GTEXT and GVTEXT subroutines are as follows:
x
is a scalar or vector containing the x coordinates of the lower left starting position of the text string's first character.

y
is a scalar or vector containing the y coordinates of the lower left starting position of the text string's first character.

text
is a vector of text strings

color
is a valid SAS color. The color argument can be specified as a quoted text string (such as 'RED'), the name of a character matrix containing a valid color as an element, or a color number (such as 1). A color number n refers to the nth color in the color list.

window
is a numeric matrix or literal specifying a window. This is given in world coordinates and has the form

 {minimum-x minimum-y maximum-x maximum-y}


viewport
is a numeric matrix or literal specifying a viewport. This is given in normalized coordinates and has the form

 {minimum-x minimum-y maximum-x maximum-y}
The GTEXT subroutine places text horizontally across a graph; the GVTEXT subroutine places text vertically on a graph. Both subroutines use hardware characters when possible. The number of text strings drawn is the maximum dimension of the first three vectors. The color argument can have more than one element. Hardware characters cannot always be obtained if you change the HEIGHT or ASPECT parameter (using GSET or GOPTIONS) or if you use a viewport. The coordinates in use for this graphics command are world coordinates.

Examples of the GTEXT and GVTEXT subroutines follow:

  
     call gopen; 
     call gport({0 0 50 50}); 
     call gset('height',4); /* shrink to one fourth of the screen */ 
     call gtext(50,50,'Testing GTEXT: This will start in the 
                        center of the viewport '); 
     call gshow; 
     call gopen; 
     call gvtext(.35,4.6,'VERTICAL STRING BY GVTEXT', 
                 'white',{0.2 -1,1.5 6.5},{0 0,100 100}); 
     call gshow;
 

Previous Page | Next Page | Top of Page