Understanding Styles

About Styles and Style Elements

ODS styles are produced from compiled STYLE templates written in PROC TEMPLATE style syntax. An ODS style template is a collection of style elements that provides specific visual attributes for your SAS output.
The style elements of a style are designed to ensure the goals of effective graphics. Each style element is a named collection of style attributes such as color, marker symbol, line style, font face, as well as many others. 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 way to change a graph's appearance. Changing the current style requires only the use of the STYLE= option on an ODS destination statement. For more information, see Specify a Style for an ODS Destination.
Note: The style that a destination uses is applied to tabular output as well as graphical output.

About the Default Styles

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. For example, the default style for the PRINTER destination is “Printer” while the default style for the RTF destination is “RTF”.
Note: Starting with SAS 9.3, the default style for the HTML destination is HTMLBlue.
For a table that lists the default styles for ODS destinations, see Working with Styles in SAS Output Delivery System: User's Guide.
You can display a list of the available styles by submitting the following PROC TEMPLATE statements:
proc template;
   list styles;
run;
You can change the default style for a destination by modifying the SAS Preferences or the SAS Registry.

Recommended Styles

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 Styles
Desired Output
Recommended Styles
Comments
Full color
HTMLBLUE1
white background, optimized for HTML output
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
JOURNAL22
interior filled areas are gray scale
Black and white
JOURNAL22
interior filled areas have no color
1HTMLBlue is the default style for the ODS HTML destination.
2Journal2 and Journal3 by default render grouped bars with fill patterns. For more information, see Using Fill Patterns to Distinguish Grouped Bar Charts.

Viewing a Style Template

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 HTMLBlue 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 Sashelp.Tmplmst to expand the list of directories where ODS templates are stored.
  3. To view the style definitions that SAS provides, double-click the Styles item store.
  4. Right-click the style definition that you want to view and select Open. The style definition is displayed in the Template Browser window.

Examples of Styles

SAS provides styles that are recommended for use with statistical graphics. Each of the following graphs was created using the HTML destination with a different style.
HTML Output Using the HTMLBlue Style
HTMLBlue Style
HTML Output Using the Analysis Style
Analysis Style
HTML Output Using the Journal Style
Journal Style
HTML Output Using the Statistical Style
Statistical Style