Graph Styles

ODS styles control the overall appearance of graphs and tables. They specify colors, fonts, line styles, symbol markers, and other attributes of graph elements. There are many more ODS styles than are listed here. Most styles are not designed for statistical work. The following styles are used most often for statistical work:

  • The HTMLBLUE style is a modern color style that is recommended for use in Web pages or color print media. See Figure 21.20 for an example. The HTMLBLUE style inherits most of its attributes from the STATISTICAL style, which inherits from the DEFAULT style. The HTMLBLUE style has a brighter appearance than its parents, and it has color coordination between the tables and graphs. The dominant color is blue.

    The HTMLBLUE style is one of the default styles for the HTML destination (depending on SAS option and registry settings). It is also the default style in SAS/STAT documentation. It is an all-color style; groups of observations are distinguished by color instead of by line style or symbol changes.[8] Most other styles simultaneously vary colors, line styles, and marker symbols to show group membership. Output that is created with the HTMLBLUE style does not print well on black-and-white devices. If you need an alternative to the HTMLBLUE style that varies colors, lines, and markers, use the HTMLBLUECML style or some other style. If you need an alternative to the HTMLBLUE style that is designed for printer destinations such as PRINTER, PDF, PS, and RTF, see the PEARL and SAPPHIRE styles.

  • The HTMLBLUECML style is a modern color style that is recommended for use in Web pages or color print media. See Figure 21.21 for an example. It inherits most of its attributes from the HTMLBLUE style. The dominant color is blue. Groups of observations are distinguished by simultaneous color, line style, and symbol changes. If you need an alternative to the HTMLBLUECML style that is all-color, use the HTMLBLUE style instead.

  • The SAPPHIRE style is a modern color style that is recommended for use in documents that are created with printer destinations such as PRINTER, PDF, PS, and RTF. See Figure 21.28 for an example. The SAPPHIRE style shares most of its attributes with the PEARL style. Both styles inherit most of their attributes from the HTMLBLUE style; hence the dominant color is blue. However, unlike HTMLBLUE (which has a very light blue background), SAPPHIRE has a white background. The SAPPHIRE style has a light blue background for row and column table headers, whereas the PEARL style has a white background. The SAPPHIRE and PEARL styles use fonts that are appropriate for printer destinations. Groups of observations are distinguished by color. Output that is created with the SAPPHIRE style might not print well on black-and-white devices.

  • The PEARL style is a modern color style that is recommended for use in documents that are created with printer destinations such as PRINTER, PDF, PS, and RTF. See Figure 21.27 for an example. The PEARL style shares most of its attributes with the SAPPHIRE style. Both styles inherit most of their attributes from the HTMLBLUE style; hence the dominant color is blue. However, unlike HTMLBLUE (which has a very light blue background), PEARL has a white background. The PEARL style also has a white background for row and column table headers, whereas the SAPPHIRE style has a light blue background. The PEARL and SAPPHIRE styles use fonts that are appropriate for printer destinations. Groups of observations are distinguished by color. Output that is created with the PEARL style might not print well on black-and-white devices.

  • The JOURNAL family of styles (JOURNAL, JOURNAL2, and JOURNAL3) consists of black-and-white or gray-scale styles that are recommended for graphs that appear in journals and in other black-and-white publications. See Figure 21.24 for an example of the JOURNAL style, see Figure 21.9 for an example of the JOURNAL2 style, and see Example 21.3 for a comparison of the three styles. See the PEARL and SAPPHIRE styles for color alternatives to the JOURNAL family of styles.

  • The DEFAULT style is a legacy color style. See Figure 21.19 for an example. Most other styles inherit some of their elements from this style. The DEFAULT style is one of the default styles for the HTML destination (depending on SAS registry and option settings). The dominant color is gray. Groups of observations are distinguished by simultaneous color, line style, and symbol changes. Output that is created with the DEFAULT style might not print well on black-and-white devices.

  • The STATISTICAL style is a legacy color style. See Figure 21.22 for an example. The STATISTICAL style inherits elements from the DEFAULT style, and it is similar in some ways (other than color) to the ANALYSIS style. The dominant colors are blue and gray. Groups of observations are distinguished by simultaneous color, line style, and symbol changes. Output that is created with the STATISTICAL style might not print well on black-and-white devices.

  • The ANALYSIS style is a legacy color style. See Figure 21.23 for an example. The ANALYSIS style inherits elements from the DEFAULT style, and it is similar in some ways (other than color) to the STATISTICAL style. The dominant colors are green and yellow. Groups of observations are distinguished by simultaneous color, line style, and symbol changes. Output that is created with the ANALYSIS style might not print well on black-and-white devices.

  • The RTF style is a legacy color style designed for graphs that will be inserted into a Microsoft Word document or a Microsoft PowerPoint slide. See Figure 21.26 for an example of the RTF style, which is the default style for the RTF destination. The RTF style inherits elements from the DEFAULT style. The dominant color is gray. Groups of observations are distinguished by simultaneous color, line style, and symbol changes. Output that is created with the RTF style might not print well on black-and-white devices. See the PEARL and SAPPHIRE styles for alternatives to the RTF style that are brighter and less gray.

  • The LISTING style is a legacy color style that is similar to the DEFAULT style, but with a lighter background. See Figure 21.25 for an example. It is the default style for the LISTING destination. The LISTING style inherits elements from the DEFAULT style. The dominant colors are black and white. Groups of observations are distinguished by simultaneous color, line style, and symbol changes. Output that is created with the LISTING style might not print well on black-and-white devices.

You specify a style with the STYLE= option in the ODS destination statement. For example, the following statement creates RTF output with the JOURNAL style:

ods rtf style=Journal;

The following statement sets the style for the LISTING destination:

ods listing style=HTMLBlue;

The style specified with the STYLE= option in the ODS LISTING statement applies only to graphs. SAS monospace format is used for tables.

Most color styles (except the HTMLBLUE, PEARL, and SAPPHIRE styles) are compromise styles in the sense that some graph elements are intentionally overdistinguished to facilitate black-and-white printing. For example, fit lines that correspond to different classification levels are distinguished by both colors and line patterns. You can use the HTMLBLUE, PEARL, and SAPPHIRE styles when you want groups to be distinguished only by color. You can easily modify any style to be an all-color style. For example:

proc template;
   define style styles.Default2;
      parent = default;
      style Graph from Graph / attrpriority = "Color";
   end;
run;

The AttrPriority = "Color" option makes a style an all-color style.

To modify some other style so that it relies only on color for distinguishability, you can use the %MODSTYLE SAS autocall macro instead (see the sections Creating an All-Color Style and Style Template Modification Macro). More generally, you can modify the colors, fonts, and other attributes of graph elements in a style by editing the style template. More information is provided in the section Styles, and detailed information is in the SAS Output Delivery System: User's Guide.



[8] More precisely, the HTMLBLUE style is an all-color style for the first 12 groups of observations, which are more than are shown in most analyses. Markers and lines change for groups 13–24 and then again for groups 25–36. Figure 21.40 shows how colors, markers, and line styles change in the HTMLBLUE style, and Figure 21.39 shows how these change in most other styles.