Statistical Graphics Using ODS

Style Templates and Colors

The default style templates that the SAS System provides are stored in the Styles directory of Sashelp.Tmplmst. You can display, edit, and save style templates by using the same that are methods available for modifying graph and table templates, as explained in the section The Default Template Stores and the Template Search Path and the series of sections beginning with the section Displaying Templates in Chapter 22: ODS Graphics Template Modification. In particular, you can display a style template by using one of the following methods:

  • Open the Templates window by entering the command odst on the command line of the SAS windowing environment, expand the Sashelp.Tmplmst node under Templates, and then select Styles to display the contents of this folder.

  • Use the SOURCE statement in PROC TEMPLATE.

For example, the following statements display the DEFAULT style template in the SAS log:

proc template;
   source Styles.Default;

Some of the results are as follows:

define style Styles.Default;
   . . .
   class GraphColors
      "Abstract colors used in graph styles" /
      . . .
      'gconramp3cend' = cxFF0000
      'gconramp3cneutral' = cxFF00FF
      'gconramp3cstart' = cx0000FF
      . . .
      'gdata12' = cxDDD17E
      'gdata11' = cxB7AEF1
      'gdata10' = cx87C873
      'gdata9' = cxCF974B
      'gdata8' = cxCD7BA1
      'gdata6' = cxBABC5C
      'gdata7' = cx94BDE1
      'gdata4' = cxA9865B
      'gdata5' = cxB689CD
      'gdata3' = cx66A5A0
      'gdata2' = cxDE7E6F
      'gdata1' = cx7C95CA;
   . . .

The first part of this list shows that the shading for certain filled plots, such as some contour plots, goes from blue (’gconramp3cstart’ = cx0000FF) to magenta (’gconramp3cneutral’ = cxFF00FF) to red (’gconramp3cend’ = cxFF0000). All colors are specified in values of the form CXrrggbb, where the last six characters specify RGB (red, green, blue) values on the hexadecimal scale of 00 to FF (0 to 255, base 10). The second part of the list (’gdata1’ = cx7C95CA) shows that the dominant component of the GraphData1 color is blue because the blue component of the color (CA, which corresponds to 202, base 10) is greater than both the green component (95, which corresponds to 149, base 10) and the red component (7C, which corresponds to 124, base 10).

You can change any part of the style and then submit the style back to the SAS System, after first submitting a PROC TEMPLATE statement. For more information about modifying, using, and restoring templates, see the sections Saving Customized Templates, Using Customized Templates, and Reverting to the Default Templates in Chapter 22: ODS Graphics Template Modification. The principles that are discussed in those sections apply to all templates—table, style, and graph.