Previous Page | Next Page

SAS/GRAPH Statements That Are Used with Statistical Graphics Procedures

TITLE and FOOTNOTE Statements



The TITLE and FOOTNOTE statements control the content, appearance, and placement of title and footnote text.
Used by: SGPLOT, SGPANEL, and SGSCATTER procedures
Valid: anywhere in your program

Syntax
Required Argument
Options
Using TITLE and FOOTNOTE Statements
Substituting BY Line Values in a Text String
Measurement Units for TITLE and FOOTNOTE Statement Options

Syntax

TITLE<1...10> <text-options> <"text-string-1"> ... <text-options><"text-string-n">;
FOOTNOTE<1...10> <text-options> <"text-string-1"> ... <text-options ><"text-string-n">;

text-options can be one or more of the following:

The following options are not supported by statistical graphics procedures:

ANGLE=

BLANK=

DRAW=

LANGLE=

LINK=

MOVE=

ROTATE=

UNDERLIN=

WRAP


Required Argument

text-string

is a text string that can contain up to 200 characters. You must enclose text strings in either single or double quotation marks. The text appears exactly as you type it in the statement, including uppercase and lowercase characters and spaces. Titles and footnotes automatically wrap to additional lines if necessary.

To use single quotation marks or apostrophes within the title, you can either:

  • use a pair of single quotation marks together:

    footnote 'All''s well that ends well';
  • enclose the text in double quotation marks:

    footnote "All's well that ends well";

Because the FOOTNOTE and TITLE statements concatenate all text strings, the strings must contain the correct spacing. With a series of strings, add spaces to the beginning of a text string rather than at the end, as in this example:

footnote color=red "Sales:" color=blue " 2000";

With fonts that support Unicode, you can produce specific characters by specifying a hexadecimal value. A trailing x identifies a string as a hexadecimal value. You must also enclose the character specification in a special ODS handler string, in the format (*ESC*){unicode 'hexadecimal-value'x}. For example:

title "Regression with Confidence Limits ( (*ESC*){unicode '03B1'x}=.05 )";
This statement produces the title, "Regression with Confidence Limits ([alpha] = .05)" because '03B1'x is the hexadecimal value for the lowercase Greek letter alpha in all Unicode fonts.

In addition, if you are using a BY statement, then you can include special options. For more information, see Substituting BY Line Values in a Text String.

Note:   The Listing destination does not honor the (*ESC*) statement.  [cautionend]


Options

BOLD

specifies that the font weight is bold for the text string.

Default: For titles, the default font weight is specified by the FONTWEIGHT attribute of the GraphTitleText style element in the current style.

For footnotes, the default font weight is specified by the FONTWEIGHT attribute of the GraphFootnoteText style element in the current style.

BCOLOR= color

specifies the background color for a box that you created with the BOX= option. For more information about specifying colors, see SAS/GRAPH Colors and Images in SAS/GRAPH: Reference, Second Edition.

This option has no effect if you do not also specify the BOX= option. By default, the background color is the same color as the background of the graph.

Alias: BC=
BOX= 1 | 2 | 3 | 4

draws a box around one line of text. Specify a value between 1 and 4, where 1 specifies the thinnest line and 4 specifies the thickest line. Only the last BOX= option is used. The color of the box outline is determined by the GraphBorderLines element of the current style.

Alias: BO
BSPACE=numeric-value<units>

specifies the amount of space between the text and the border of a box that you create with the BOX= option.

You can also specify the unit of measure. See Measurement Units for TITLE and FOOTNOTE Statement Options for a list of the units that are supported.

If you do not specify a unit, then the size of the space is approximately 12n points. For example, if you specify BSPACE=2, then the space is approximately 24 points.

Alias: BS=
Default: 0
COLOR= color

specifies the color for the text. The COLOR= option affects all of the text strings that follow it in your TITLE or FOOTNOTE statement. For more information about specifying colors, see SAS/GRAPH Colors and Images in SAS/GRAPH: Reference, Second Edition.

You can use multiple colors by specifying multiple COLOR= options. For example, the following code produces a title where the first word is red and the second word is blue:

title color=red "Red" color=blue " Blue";
Alias: C=
Default: For titles, the default text color is specified by the COLOR attribute of the GraphTitleText style element in the current style.

For footnotes, the default font color is specified by the COLOR attribute of the GraphFootnoteText style element in the current style.

FONT= "system-font"

specifies a system font for the text string.

Note:   SAS/GRAPH software fonts such as SWISS cannot be used with statistical graphics procedures.  [cautionend]

Alias: F=
Default: For titles, the default font is specified by the FONTFAMILY attribute of the GraphTitleText style element in the current style.

For footnotes, the default font is specified by the FONTFAMILY attribute of the GraphFootnoteText style element in the current style.

HEIGHT= numeric-value <units>

specifies the size of the text. You can also specify the unit of measurement. The following table lists the measurement units that are supported:

You can also specify the unit of measure. See Measurement Units for TITLE and FOOTNOTE Statement Options for a list of the units that are supported.

If you do not specify a unit, then the size of the text is approximately 12n points. For example, if you specify HEIGHT=2, then the text size is approximately 24 points.

Alias: H=
Default: For titles, the default font size is specified by the FONTSIZE attribute of the GraphTitleText style element in the current style.

For footnotes, the default font size is specified by the FONTSIZE attribute of the GraphFootnoteText style element in the current style.

ITALIC

specifies that the font style is italic for the text string.

Default: For titles, the default font style is specified by the FONTSTYLE attribute of the GraphTitleText style element in the current style.

For footnotes, the default font style is specified by the FONTSTYLE attribute of the GraphFootnoteText style element in the current style.

JUSTIFY= LEFT | CENTER | RIGHT

specifies the alignment of the text string. You can specify one of the following values:

LEFT | L

aligns the text to the left.

CENTER | C

aligns the text in the center.

RIGHT | R

aligns the text to the right.

The JUSTIFY= option affects all of the text strings that follow it in your TITLE or FOOTNOTE statement. You can specify multiple alignments by using more than one JUSTIFY= option. For example, the following code creates a footnote where the first string is aligned to the left and the second string is aligned to the right:

footnote justify=left "Example 2" justify=right "Graph 3";
Alias: J=
LSPACE= numeric-value <units>

specifies the amount of space above the title text and below the footnote text.

You can also specify the unit of measure. See Measurement Units for TITLE and FOOTNOTE Statement Options for a list of the units that are supported.

If you do not specify a unit, then the size of the space is approximately 12n points. For example, if you specify LSPACE=2, then the space is approximately 24 points.

Alias: LS
Interaction: The LSPACE= option has no effect if you also specify the BOX= option.
Default: 0


Using TITLE and FOOTNOTE Statements

You can define TITLE and FOOTNOTE statements anywhere in your SAS program. They are global and remain in effect until you cancel them or until you end your SAS session. All currently defined FOOTNOTE and TITLE statements are displayed automatically.

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 equivalent to a TITLE1 or FOOTNOTE1 statement. It is not necessary to use sequential statement numbers--skipping a number in the sequence leaves a blank line.

You can use an unlimited number of text strings and options. Ensure that each option is placed before the text strings that you want it to modify.

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, then submitting a new TITLE2 statement cancels TITLE3.

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.

title4;

But remember that this cancels all other existing statements of a higher number.

To cancel all current TITLE or FOOTNOTE statements, use the TITLE1; or FOOTNOTE1; statement:


Substituting BY Line Values in a Text String

These options are available if a BY statement is in effect:

#BYLINE

substitutes the entire BY line without leading or trailing blanks for #BYLINE in the text string. The BY line uses the format variable-name=value.

#BYVALn | #BYVAL(BY-variable-name)

substitutes the current value of the specified BY variable for #BYVAL in the text string. Specify the variable with one of these:

n

specifies a variable by its position in the BY statement. For example, #BYVAL2 specifies the second variable in the BY statement.

BY-variable-name

specifies a variable from the BY statement by its name. For example, #BYVAL(YEAR) specifies the BY variable, YEAR. variable-name is not case sensitive.

#BYVARn | #BYVAR(BY-variable-name)

substitutes the name of the BY-variable or the label associated with the variable (whatever the BY line would normally display) for #BYVAR in the text string. Specify the variable with one of these:

n

specifies a variable by its position in the BY statement. For example, #BYVAR2 specifies the second variable in the BY statement.

BY-variable-name

specifies a variable from the BY statement by its name. For example, #BYVAR(SITES) specifies the BY variable, SITES. Variable-name is not case sensitive.

Note:   A BY variable name displayed in a title or footnote is always in uppercase. If a label is used, then it appears as specified in the LABEL statement.  [cautionend]

To use the #BYVAR and #BYVAL substitutions, insert the item in the text string at the position where you want the substitution text to appear. Both #BYVAR and #BYVAL specifications must be followed by a delimiting character, either a space or other non-alphanumeric character, such as the quotation mark that ends the text string. If not, then the specification is ignored and its text remains intact and is displayed with the rest of the string. To allow a #BYVAR or #BYVAL substitution to be followed immediately by other text, with no delimiter, use a trailing dot (as with macro variables). The trailing dot is not displayed in the resolved text. If you want a period to be displayed as the last character in the resolved text, use two dots after the #BYVAR or #BYVAL substitution.

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, then 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 continues to display a BY line at the top of the page unless you suppress it by using the NOBYLINE option in an OPTION statement.


Measurement Units for TITLE and FOOTNOTE Statement Options

Some of the options in the TITLE and FOOTNOTE statements give you the option to specify the unit of measurement. The following table lists the units that are supported:

Measurement Units
Unit Description
CM centimeters
IN inches
PCT or % percentage
PT point size, calculated at 100 dots per inch

Previous Page | Next Page | Top of Page