TITLE statement

You can use TITLE statements to specify lines of text to be printed at the top of SAS/GRAPH displays. By specifying certain options in a TITLE statement, you can control the color, type font, type size, and position of lines of text in a title.

The general form of the TITLE statement is

TITLEn options 'text';
where
n
is a number that represents the line to be occupied by the title. If you do not specify a number following the keyword TITLE, TITLE1 is assumed. You can specify up to 10 TITLE statements.

Once you specify a TITLE statement for a line, the text of that statement is printed on all graphic displays until you specify another TITLE statement for that line or cancel the TITLE statement. When a TITLE statement is specified for a given line, it cancels all TITLE statements previously defined for that line and for all lines below it. To cancel all titles defined for a procedure, specify


TITLE;

options
allow you to specify the color, type font, type size, and position of the text appearing in a TITLE statement. You can specify an option anywhere within the TITLE statement. An option remains in effect until that option is changed or until the end of the statement. The values for many of these options can be specified at the system level in a GOPTIONS statement, or you can use the defaults for these options. Thus, you can control as few or as many of these options as you want to.

The following options can be specified in a TITLE statement:

COLOR=color
C=color
names the color to use for the text that follows the specification. If you omit C=, the title is displayed using the color specified by the CTITLE= option of your GOPTIONS statement. If you did not specify the CTITLE= option, the first color in the COLORS= list in the GOPTIONS statement is used. If you also omitted the COLORS= option, the first default color for your graphics device is used.

FONT=typefont
F=typefont
names the type font to use for the text that follows the specification.

The following type fonts are available when you specify the F= (or FTITLE=) option. Brief descriptions of some of the fonts are included below. The SAS/GRAPH fonts can be proportionately or uniformly spaced. Proportionately spaced fonts contain characters of various sizes; for example, the letter M may take up twice as much space as the letter I. Uniformly spaced fonts contain characters of equal sizes; for example, the letter M takes up the same amount of space as the letter I. You might want to use this feature if you want to vertically align characters in text lines.

CARTOG
A set of 19 cartographic symbols.
COMPLEX
A serif stroked font, formed from double lines
CSCRIPT
Script version of COMPLEX font
DUPLEX
A sans serif stroked font, formed from double lines
GERMAN
German style letters
GITALIC
Italic version of GERMAN
GREEK
Greek alphabet, upper and lower case, stroked font made from single lines
KANJI
Chinese character, Japanese version slightly different from Chinese version and similar to the difference between British English and American English
KATAKANA
Japanese Katakana alphabet (specify F=KATA)
MATH
Math symbols
MUSIC
A set of 19 musical symbols.
NHEBREW, NHEBREWE
Hebrew alphabet, solid and unfilled letters (uses new hexadecimal representation)
SCRIPT
Script letters, drawn with single lines.
SIMPLEX
Sans serif font drawn with single lines.
SWISS, SWISSE
Helvetica font, solid and unfilled letters

HEIGHT=n
H=n
specifies the height of the characters. You can set HEIGHT equal to n PCT (where n is expressed as a percentage of the display area); n IN (where n is expressed in inches); n CM (where n is expressed in centimeters); or n CELL (where n is expressed in character cell units). If you do not specify a unit with n, the value specified with the GUNIT= option in a GOPTIONS statement is used. If you did not specify a GUNIT= value, the default value, character cells, is used.

Default type size for first title line: If you omit the H= option for the first title line, the default value of 2 is used. The unit used will be the one you specified with the GUNIT= option. If you did not specify a GUNIT= value, the default value, character cells, is used.

Default type size for later title lines: If you omit the H= option for title lines after the first title line, the default value of 1 is used. The unit used will be the one you specified with the GUNIT= option. If you did not specify a GUNIT= value, the default value, character cells, is used.

Note: If your text line is too long to be displayed in the character height specified in the H= option, the H= size is reduced so that the text can be displayed.

J=LEFT|L
J=RIGHT|R
J=CENTER|C
controls the alignment on the page of title lines. When you specify J=LEFT, all following text is left aligned on the graphic display. When you specify J=RIGHT, all following text is right aligned. J=CENTER is the default; if you omit the J= option, the title is centered. If you specify the same value for J= more than once in the same statement, the text appears on separate lines.

All titles are displayed without regard to other text already on the graphic display. Thus, it is possible to overlay existing text.

ANGLE=angle
A=angle
specifies the angle at which to display lines of text. Angle values can range from -90 to +90 degrees. If you do not specify an angle, text is displayed horizontally (A=0) from the top of the page or screen down. When an angle is specified, it remains in effect until another angle is specified or until the end of the statement.

ROTATE=angle
R=angle
specifies the degree at which to rotate each character of the text that follows the specification. The value of angle can range from 0 to 360 degrees. Normally, text is drawn in an upright position (R=0). You can specify both R= and A= values in a TITLE statement.

MOVE=(x,y)

M=(x,y)
allows you to move text by specifying the coordinates for the starting location. Commas between coordinates are optional. You can specify coordinates with or without a unit, and you can use various combinations of units in one specification. For example, you can set MOVE equal to x,y PCT (where x,y is expressed as a percentage of the display area); x,y IN (where x,y is expressed in inches); x,y CM (where x,y is expressed in centimeters), or x,y CELL (where x,y is expressed in character cell units). If you do not specify a unit with x,y, the value specified with the GUNIT= option in a GOPTIONS statement is used. If you did not specify a GUNIT= value, the default value, character cells, is used.

In addition, the following are both valid forms of specifying MOVE= values:

MOVE=(x CM, Y PCT)
MOVE=(x,y) IN
The values of x and y can be specified as positive or negative numbers to indicate that the text is to be displayed relative to the end of the preceding text. J= is ignored for text positioned with the M= option.

DRAW=(coordinates)
D=(coordinates)
enables you to draw lines on the display. You can use the D= option to underline text or draw a box around titles. The list of coordinates has the form
(x sub 1 , y sub 1 , x sub 2 , y sub 2 , x sub 3 , y sub 3 , ... , x sub n , y sub n )
Commas between coordinates are optional. Each coordinate can be specified with or without a unit, and you can use various combinations of units. For example, you can set DRAW equal to x,y PCT (where x,y is expressed as a percentage of the display area); x,y IN (where x,y is expressed in inches); x,y CM (where x,y is expressed in centimeters); or x,y CELL (where x,y is expressed in character cell units). If you do not specify a unit with x,y, the value specified with the GUNIT= option in a GOPTIONS statement is used. If you did not specify a GUNIT= value, the default value, character cells, is used. The DRAW= option does not affect the position of text.

LANGLE=angle
LA=angle
specifies the number of degrees from the horizontal at which the text is to be rotated. The value of angle can be a positive or a negative number. The LANGLE= option differs from the ANGLE= option in that for LANGLE= there are no special cases (for specifications of ANGLE=+90 or -90 or 0 degrees).

LSPACE=n
LS=n
controls the spacing above lines of text specified in TITLE statements. You can set LSPACE equal to n PCT (where n is expressed as a percentage of the display area); n IN (where n is expressed in inches); n CM (where n is expressed in centimeters); or n CELL (where n is expressed in character cell units); If you do not specify a unit with n, the value specified with the GUNIT= option in a GOPTIONS statement is used. If you did not specify a GUNIT= value, the default value, character cells, is used. If you omit the LSPACE= option, the default value is used.

The LSPACE= option remains in effect only for the duration of the statement in which you specify it.

UNDERLIN=0,1,2,3
U=0,1,2,3
specifies to underline the text that follows. If you specify UNDERLIN=1, 2, or 3, text is underlined with an increasingly thicker line. If you want to stop underlining a portion of the text, specify UNDERLIN=0. If you specify an LANGLE= or ANGLE= option for the line of text, the underline is drawn at the same angle as the text. The color of the underline is the color value currently in effect.

BOX=0, 1, 2, 3
BO=0, 1, 2, 3
specifies to draw a box around the text of the TITLE statement in which it appears. If you specify BOX=1, 2, or 3, the box is drawn with an increasingly thicker line. Unlike the UNDERLINE= option, the BOX= option does not rotate the lines used to draw the box to match rotated text. The color of the box is the color value currently in effect.

Note: The BOX= option is processed after all the text in a TITLE statement has been processed. Therefore, if multiple commands are given, only the last one is processed.

BCOLOR=color
BC=color
specifies the color of the background within the box. The BCOLOR= color may be different from the color of the outline of the box. The default is to have the background color the same as the background color for the entire display.

Note: The BCOLOR= option is processed after all the text in a TITLE statement has been processed. Therefore, if multiple commands are given, only the last one is processed.

BSPACE=positive number
BS=positive number
controls the amount of space reserved around the text that appears in a box. You can set BSPACE equal to n CELL (where n is expressed in character cell units); n PCT (where n is expressed as a percentage of the display area); n IN (where n is expressed in inches); or n CM (where n is expressed in centimeters). If you do not specify a unit with n, the value specified with the GUNIT= option in a GOPTIONS statement is used. If you did not specify a GUNIT= value, the default value, character cells, is used. The default BSPACE= value is one. When you specify a BSPACE= value, that value is reserved around the text string enclosed in the box.

Note: The BSPACE= option is processed after all the text in a TITLE statement has been processed. Therefore, if multiple commands are given, only the last one is processed.

BLANK=YES
BL=YES
specifies that nothing else be drawn around the text in the box after the text has been drawn. The BLANK= option allows you to appear to overlay a line of text on top of a graph. The BLANK= option is ignored if the BOX= option is not specified.

Note: The BLANK= option is processed after all the text in a TITLE statement has been processed. Therefore, if multiple commands are given, only the last one is processed.

'text'
is the text displayed by your output device. If the system option NOTEXT82 is in effect, the text must be enclosed in single quotes (or double quotes, if the DQUOTE option is also in effect). If the system option TEXT82 is in effect, the text does not have to be enclosed in single quotes, but a warning message is printed. The text appears exactly as it does in your TITLE statement, including only the blanks within the quotes. All other blanks are ignored.

Prepared by Michael Friendly
Email<friendly@yorku.ca>
Last Updated:Friday, July 19, 1995

[Previous] Previous Document. [Next] Next Document.