Previous Page | Next Page

Statistical Graphics Using ODS

Style Definitions and Colors

The default style definitions that SAS provides are stored in the Styles directory of SASHELP.Tmplmst. You can display, edit, and save style definitions by using the same methods available for modifying template definitions, as explained in the section The Default Template Libraries and the ODS PATH and the series of sections beginning with Displaying Templates. In particular, you can display a style definition by using one of these methods:

  • From the Templates window in the SAS windowing environment, expand the SASHELP.Tmplmst node under Templates, and then select Styles to display the contents of this folder. To open the Templates window, type odst in the command line.

  • Use the SOURCE statement in PROC TEMPLATE.

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

   proc template;
      source Styles.Default;

The following are some of the results:

   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 (or 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 into SAS, after first submitting a PROC TEMPLATE statement. See the sections Saving Customized Templates, Using Customized Templates, and Reverting to the Default Templates for more information about modifying, using, and restoring templates. The principles discussed in those sections apply to all templates—table, style, and graph.

Previous Page | Next Page | Top of Page