Previous Page | Next Page

Controlling The Appearance of Your Graphs

Specifying a Style


About Style Templates

An ODS style is a collection of named style elements that provides specific visual attributes for the presentation aspects (color, font face, font size, and so on) of your graphical and tabular SAS output. Each style element is a named collection of style attributes such as color, marker symbol, line style, font face, as well as many others. The style elements of a style are designed to ensure the goals of effective graphics. The colors used for drawing the markers in a scatter plot are designed to contrast well against the data wall color. Each graphical element of a plot, such as a marker, a bar, a line or a title, derives its visual attributes from a specific style element from the active style. Changing the style for an ODS destination is the easiest, simplest way of changing a graphic's appearance. Changing the current style requires only the use of the STYLE= option on an ODS destination statement.

Note:   The style that a destination uses is applied to tabular output as well as graphical output.  [cautionend]

Every ODS output destination has a default style associated with it. These default styles are different for each destination; therefore your output might look different depending on which destination you use.

If your program does not specify a style to use, then the following styles are in effect:

Default Style Templates
ODS Destination Default Style Name
DOCUMENT (not applicable)
LISTING Listing
OUTPUT (not applicable)
HTML Default
LATEX Default
PRINTER ColorPrinter for PDF and PS, monochromePrinter for PCL
RTF RTF
Measured RTF RTF

Note:   You can change the default style template for each destination by modifying the SAS registry. See Changing the Default Style in the SAS Registry.  [cautionend]

SAS ships a set of styles that have been designed by GUI experts to address the needs of different situations, while ensuring the principles of effective graphics. The following is a subset of the styles shipped with SAS that are particularly suited for statistical graphics:

Recommended Style Templates
Desired Output Recommended Styles Additional
Full Color Default gray background, optimized for HTML output
Analysis yellow background
Statistical white background, colored fills
Listing white background, optimized for color format on white paper
Printer optimized for PS and PDF output
Gray Scale Journal interior filled areas are gray scale
Black and White Journal2 interior filled areas have no color

You can view the styles that SAS provides by using the command line or the SAS Windowing Environment.

To use the SAS Windowing Environment, follow these steps:

  1. In the Results window, select the Results folder. Right-click and select Templates to open the Templates window.

  2. Double-click Sashelp.Tmplmst to view the contents of that directory.

  3. Double-click Styles to view the contents of that directory.

  4. Double-click the style definition that you want to view. For example, the Default style definition is the template store for HTML output. Similarly, the RTF style definition is the template store for RTF output.

To use the command line, follow these steps:

  1. To view the Templates window, submit this command in the command line:

    odstemplates

    The Templates window contains the item stores Sasuser.Templat and Sashelp.Tmplmst.

  2. Double-click an item store, such as Sashelp.Tmplmst, to expand the list of directories where ODS templates are stored. The templates that SAS provides are in the item store Sashelp.Tmplmst.

  3. To view the style definitions that SAS provides, double-click the Styles item store.

  4. Right-click the style definition, such as Journal, and select Open. The style definition is displayed in the Template Browser window.


Changing the Current Graph Style by Using the STYLE= Option in ODS Destination Statements

Each ODS destination has a default style that is set by SAS. By specifying only STYLE=style-definition in your ODS destination statement, you can create an entirely different appearance for your graphs. For example, you can specify that ODS apply the Styles.Journal style template to all HTML output with one of the following statements:

ods html style=styles.journal;
ods html style=journal;

This style is applied to all output for that destination until you change or close the destination or start a new SAS session.

To view the supplied ODS styles, open the Template window, and navigate to Templates [arrow] Sashelp.Tmplmst [arrow] Styles. You can open the Template window by specifying ODSTEMPLATE in the command line or from the Results window. To open the Template window from the Results window, open the Results window, select the Results folder. Right-click and select Templates.

Style templates are created and modified with the TEMPLATE procedure. For more information, refer to SAS Output Delivery System: User's Guide.


Examples of Style Templates

SAS provides styles that are recommended for use with statistical graphics. Each of the following graphs was created using a different style, with the HTML destination:

HTML Output Using the Default Style

[HTML Output Using the Default Style]

HTML Output Using the Analysis Style

[HTML Output Using the Analysis Style]

HTML Output Using the Journal Style

[HTML Output Using the Journal Style]

HTML Output Using the Statistical Style

[HTML Output Using the Statistical Style]


Changing the Default Style in the SAS Registry

By default, the SAS registry is configured to apply a default style to the output for each ODS destination. The default style for each destination can be different. For example, the default style for the PRINTER destination is "Printer" while the default style for the RTF destination is "RTF". To permanently change the default style, you can change the setting of Selected Style in the SAS registry. For more information about ODS and the SAS registry, see Changing SAS Registry Settings for ODS in SAS Output Delivery System: User's Guide.

To permanently change the default style for a particular destination:

  1. Select Solutions [arrow] Accessories [arrow] Registry Editor, or issue the command REGEDIT in the command line.

  2. Select ODS [arrow] Destinations

  3. Select the destination you want to change the default style for.

  4. Select Selected Style, click the right mouse button, and select Modify. The Edit String Value window appears.

  5. Type the style in the Value Data text box and select OK.

CAUTION:
If you make a mistake when you modify the SAS registry, then your system might become unstable or unusable.   [cautionend]

SAS Registry Showing Selected Style Setting

[SAS Registry Showing Selected Style Setting]

Previous Page | Next Page | Top of Page