Chapter Contents |
Previous |
Next |
SAS/GRAPH Software: Reference |
The TITLE, FOOTNOTE, and NOTE statements control the content, appearance, and placement of text.
Global: TITLE and FOOTNOTE
TITLE, FOOTNOTE, and NOTE statements add text to maps, plots, charts, and text slides. With these statements you can
Default Placement of Titles, Footnotes, and Notes shows the default appearance and placement of titles, footnotes, and notes on the graphics output area.
Default Placement of Titles, Footnotes, and Notes
TITLE statements have these default characteristics:
Space for the title area and the footnote area is taken from the procedure output area. The more titles and footnotes you specify and the bigger they are, the smaller the procedure output area will be.
Notes are positioned at the top of the procedure output area and are left justified. The statements appear one below another in the order they appear in the program. Unless otherwise specified, they use the default hardware font and are one unit high.
For more information on titles, footnotes, and notes
in the graphics output area, see Placement of Graphic Elements in the Graphics Output Area.
TITLE<1...10><text-argument(s)>; |
FOOTNOTE<1...10><text-argument(s)>; |
NOTE<text-arguments(s)>; |
text-argument(s) can be one or more of
these in any order:
|
text-options can be one or more options from any or all of the following categories:
COLOR=color | |
FONT=font | |
HEIGHT=text-height<units> |
JUSTIFY=LEFT | CENTER | RIGHT | |
LSPACE=line-space<units> | |
MOVE=(x,y)<units> |
ANGLE=degrees | |
LANGLE=degrees | |
ROTATE=degrees |
BCOLOR=background-color | |
BLANK=YES | |
BOX=1...4 | |
BSPACE=box-space<units> | |
DRAW=(x,y...,x-n,y-n)<units> | |
UNDERLIN=0...3 |
When the syntax of an option includes units, use one of these:
CELLS | character cells |
CM | centimeters |
IN | inches |
PT | points |
PCT | percentage of the graphics output area |
If you omit units, a unit specification is searched for in this order:
Angled titles or footnotes may require more vertical space and, consequently, may increase the size of the title area or the footnote area, thereby reducing the vertical space in the procedure output area.
Using the BOX= option with angled text does not produce angled boxes; the box is sized to accommodate the angled note.
Using the ANGLE= option after one text string and before another can reset some options to their default values. See Using Options That Can Reset Other Options.
ANGLE= has the same effect on the text as LANGLE=, except when you specify an angle of 90 degrees or -90 degrees. In these angle specifications, the procedure output area is shrunk from the left or right to accommodate the angled title or footnote. The result depends on the statement in which you use the option:
Positioning Titles with the ANGLE= Option shows how ANGLE=90 degrees or ANGLE=-90 degrees positions and rotates title text.
Positioning Titles with the ANGLE= Option
Positioning Footnotes with the ANGLE=Option shows how ANGLE=90 degrees or ANGLE=-90 degrees positions and rotates footnote text.
Positioning Footnotes with the ANGLE=Option
Positioning Notes with the ANGLE= Option shows how ANGLE= 90 degrees or -90 degrees positions and rotates note text.
Positioning Notes with the ANGLE= Option
See also: | the LANGLE= option and the ROTATE= option |
Featured in: | Example 6. Enhancing Titles |
Note: BCOLOR=
may be reset by ANGLE= or JUSTIFY=, or by MOVE= with absolute coordinates.
See Using Options That Can Reset Other Options
for details.
See also: | the BOX= option |
Featured in: | Example 6. Enhancing Titles |
Note: BLANK= may be reset by ANGLE= or JUSTIFY=, or by MOVE=
with absolute coordinates. See Using Options That Can Reset Other Options
for details.
See also: | the BOX= option |
Featured in: | Example 6. Enhancing Titles |
The color of the box is either:
COLOR= affects only the frame of the box. To color the background of the box, use BCOLOR=.
You can include more than one text string in the box as long as no text break occurs between the strings; that is, you cannot use JUSTIFY= to create multiple lines of text within a box.
To draw a box around multiple lines of text, you can either
note font=swiss justify=center box=3 'Office Hours' move=(40pct,-12pct) '9-5';
Using the BOX= Option and the MOVE= Option to Box Multiple Lines of Text
Note: BOX= may be reset by ANGLE= or JUSTIFY=,
or by MOVE= with absolute coordinates. See Using Options That Can Reset Other Options for details.
See also: | the BCOLOR= option and the BLANK= option and the BSPACE= option |
Featured in: | Example 6. Enhancing Titles |
The spacing is uniform around the box. For example, BSPACE=.5IN leaves one-half inch of space between the text and the top, bottom, and sides of the box.
Note: BSPACE= may be reset by
ANGLE= or JUSTIFY=, or by MOVE= with absolute coordinates. See Using Options That Can Reset Other Options for details.
See also: | the BOX= option |
Change colors as often as you like. For example, this statement produces a title with red text in a box with a blue frame and a cream background:
title color=red 'Total Sales' color=blue box=3 bcolor=cream;
Although BCOLOR= controls the background color of the box, the frame color is controlled with the COLOR= that precedes BOX=.
If you omit COLOR=, a color specification is searched for in this order:
See also: | the BCOLOR= option |
Absolute Coordinates | Relative Coordinates |
---|---|
x<units> |
±x<units> |
y<units> |
±y<units> |
The coordinate position (0,0) is the lower-left corner of the graphics output area. Specify at least two coordinate pairs. Commas between coordinates are optional; blanks can be used instead. DRAW= does not affect the positioning of text.
The starting point for lines specified with relative coordinates begins at the end of the most recently drawn text or line in the current statement. If no text or line has been drawn in the current statement, a warning is issued and the relative draw is measured from where a zero-length text string would have ended, given the normal placement for the statement.
You can mix relative and absolute coordinates. For example, DRAW=(+0,+0,+0,1IN) draws a vertical line from the end of the text to one inch from the bottom of the graphics output area.
Featured in: | Example 6. Enhancing Titles |
If your text line is too long to be displayed in the height specified in HEIGHT=, the height specification is reduced so that the text can be displayed. A note in the SAS log tells you what percentage of the specified size was used.
If you omit HEIGHT=, a text height specification is searched for in this order:
By default, a TITLE1 title is twice the height of all other titles.
Featured in: | Example 1. Ordering Axis Tick Marks with SAS Datetime Values and Example 6. Enhancing Titles |
All the text strings following JUSTIFY= are treated as a single string and are displayed as one line that is left-, right-, or center-aligned.
You can change the justification within a single line of text. For example, this NOTE statement displays a date on the left side of the output and the page number on the same line on the right:
note 'June 28, 1997' justify=right 'Page 3';
In addition, you can use JUSTIFY= to produce multiple lines of text by repeating JUSTIFY= with the same value before the text string for each line. Multiple lines of text with the same justification are blocked together. For example, this TITLE statement produces a three-line title with each line right-justified:
title justify=right 'First Line' justify=right 'Second Line' justify=right 'Third Line';
You can get the same effect with three TITLE statements, each specifying JUSTIFY=RIGHT. If you produce a block of text by specifying the same justification for multiple text strings, and then change the justification for an additional text string, that text is placed on the same line as the first string specified in the statement.
Note: Using
JUSTIFY= after one text string and before another can reset some options to
their default values. See Using Options That Can Reset Other Options.
Featured in: | Example 3. Rotating Plot Symbols through the Colors List |
Angled titles or footnotes may require more vertical space and consequently may increase the size of the title area or the footnote area, thereby reducing the vertical space in the procedure output area.
Using BOX= with angled text does not produce an angled box; the box is sized to accommodate the angled note.
Unlike ANGLE=, LANGLE= does not reset any other options. Therefore, LANGLE= is easier to use because you do not need to repeat options after a text break.
LANGLE= has the same effect on the text as ANGLE=, except when you specify an angle of 90 degrees or -90 degrees. With these specifications, the result depends on the statement in which you use the option:
Positioning Titles with the LANGLE= Option shows how LANGLE=90 degrees and LANGLE=-90 degrees positions and rotates titles.
Positioning Titles with the LANGLE= Option
Positioning Footnotes with the LANGLE= Option shows how LANGLE=90 degrees and LANGLE=-90 degrees positions and rotates footnotes.
Positioning Footnotes with the LANGLE= Option
Positioning Notes with the LANGLE= Option shows how LANGLE=90 degrees and LANGLE=-90 degrees positions and rotates notes.
Positioning Notes with the LANGLE= Option
See also: | the ANGLE= option |
Note: LSPACE= may be reset by ANGLE= or JUSTIFY=, or by MOVE=
with absolute coordinates. See Using Options That Can Reset Other Options
for details.
Absolute Coordinates | Relative Coordinates |
---|---|
x<units> |
±x<units> |
y<units> |
±y<units> |
Commas between coordinates are optional; you can use blanks instead.
The starting point for lines specified with relative coordinates begins with the end of the most recently drawn text or line in the current statement. If no text or line has been drawn in the current statement, a warning is issued and the relative move is measured from where a zero-length text string would have ended, given the normal placement for the statement. You can mix relative and absolute coordinates.
MOVE= overrides a JUSTIFY= specified for the same text string.
If a NOTE, FOOTNOTE, or TITLE statement uses MOVE= to position the text so that the statement does not use its default position, the text of the next NOTE, FOOTNOTE, or TITLE statement occupies the unused position and no blank lines are displayed.
Note: If
you specify MOVE= with at least one absolute coordinate and if the option
follows one text string and precedes another, some options can be reset to
their default values. See Using Options That Can Reset Other Options.
Featured in: | Example 2. Specifying Logarithmic Axes and Example 6. Enhancing Titles |
Tilting Characters with the ROTATE= Option shows how characters are positioned when ROTATE=90 is used with the default (horizontal) baseline.
Tilting Characters with the ROTATE= Option
See also: | the ANGLE= option |
Featured in: | Example 6. Enhancing Titles |
To use single quotation marks or apostrophes within the title, you can either
footnote 'All''s Well That Ends Well';
footnote "All's Well That Ends Well";
Because FOOTNOTE, NOTE, and TITLE statements concatenate all text strings, the strings must contain the correct spacing. With a series of strings, add blanks at the beginning of a text string rather than at the end, as in this example:
note color=red 'Sales:' color=blue ' 2000';
With some fonts, you produce certain characters by specifying
a hexadecimal value. A trailing
x
identifies a string as
a hexadecimal value. For example, this statement(footnote 1) produces the title
Profits Increase
£
3,000
:
title font=swiss 'Profits Increase ' '18'x '3,000';
For more information see Specifying Special Characters.
In addition, you can embed one or more of the following in the string:
n | specifies which variable in the BY statement #BYVAL should use. The value of n indicates the position of the variable in the BY statement. For example, #BYVAL2 specifies the second variable in the BY statement. |
BY-variable-name | names the BY variable. For example, #BYVAL(YEAR) specifies the BY variable, YEAR. Variable-name is not case sensitive. |
Featured in: | Example 7. Using BY-group Processing to Generate a Series of Charts and Example 9. Combining Graphs and Reports in a Web Page |
n | specifies which variable in the BY statement #BYVAR should use. The value of n indicates the position of the variable in the BY statement. For example, #BYVAR2 specifies the second variable in the BY statement. |
BY-variable-name | names the BY variable. For example, #BYVAR(SITES) specifies the BY variable, SITES. Variable-name is not case sensitive. |
A BY variable name displayed in a title, note, or footnote is always in uppercase. If a label is used, it appears as specified in the LABEL statement.
For more information, see Substituting BY Line Values in a Text String.
Underlines follow the text baseline. If you use an LANGLE= or ANGLE= option for the line of text, the underline is drawn at the same angle as the text. Underlines do not break up to follow rotated characters. See the ROTATE= option.
To make the text and the underline the same color, specify a COLOR= before the UNDERLIN= that precedes the text string. To make the text a different color, specify COLOR= after the UNDERLIN=.
Note: UNDERLIN= may be reset by ANGLE= or
JUSTIFY=, option, or by the MOVE= option with absolute coordinates. See Using Options That Can Reset Other Options for details.
Featured in: | Example 6. Enhancing Titles |
Using TITLE and FOOTNOTE Statements |
You can define up to ten TITLE statements and ten FOOTNOTE statements in your SAS session. A TITLE or FOOTNOTE statement without a number is treated as a TITLE1 or FOOTNOTE1 statement. You do not have to start with TITLE1 and you do not have to use sequential statement numbers. Skipping a number in the sequence leaves a blank line.
You can use as many text strings and options as you want, but place the options before the text strings they modify. See Using Multiple Options.
The most recently specified TITLE or FOOTNOTE statement of any number completely replaces any other TITLE or FOOTNOTE statement of that number. In addition, it cancels all TITLE or FOOTNOTE statements of a higher number. For example, if you define TITLE1, TITLE2, and TITLE3, resubmitting the TITLE2 statement cancels TITLE3.
To cancel individual TITLE or FOOTNOTE statements, define a TITLE or FOOTNOTE statement of the same number without options (a null statement):
title4;
But remember that this will cancel all other existing statements of a higher number.
To cancel all current TITLE or FOOTNOTE statements, use the RESET= graphics option in a GOPTIONS statement:
goptions reset=footnote;
Specifying RESET=GLOBAL or RESET=ALL also cancels all current TITLE and FOOTNOTE statements as well as other settings.
Using the NOTE Statement |
You can use as many text strings and options as you want, but place the options before the text strings they modify. See Using Multiple Options.
Using Multiple Options |
For example, this statement specifies that one part of the note be red and another part blue, but the height for all the text is 4:
note height=4 color=red 'Red Tide' color=blue ' Effects on Coastal Fishing';
Setting Defaults |
See Graphics Options and Device Parameters Dictionary for a complete description of each option.
Using Options That Can Reset Other Options |
Note: The LANGLE= option does not
cause a text break.
If in a TITLE, FOOTNOTE, or NOTE statement, before the first text string, you use an option that can be reset (such as UNDERLIN=) and before the second string you use an option that resets it (such as JUSTIFY=), the first option does not affect the second string. In order for the first option to affect the second string, repeat the option and position it after the resetting option and before the text string.
For example, this statement produces a two-line title in which only the first line is underlined:
title underlin=2 'Line 1' justify=left 'Line 2';
To underline Line 2, repeat UNDERLIN= before the second text string and after JUSTIFY=:
title underlin=2 'Line 1' justify=left underlin=2 'Line 2';
Substituting BY Line Values in a Text String |
If you use a #BYVAR or #BYVAL specification for a variable that is not named in the BY statement (such as #BYVAL2 when there is only one BY-variable or #BYVAL(ABC) when ABC is not a BY-variable or does not exist), or if there is no BY statement at all, the substitution for #BYVAR or #BYVAL does not occur. No error or warning message is issued and the option specification is displayed with the rest of the string. The graph will continue to display a BY line at the top of the page unless you suppress it by using the NOBYLINE option in an OPTION statement.
For more information, see BY Statement.
Note: This feature is
not available in the Data Step Graphics Interface or in the Annotate facility
since BY lines are not created in a DATA step.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.