Statistical Graphics Using ODS

ODS Style Template Modification Macro

The %ModStyle macro provides easy ways to customize the style elements (GraphData1GraphDatan) that control how groups of observations are distinguished. Examples of using the %ModStyle macro can be found in the section Changing the Default Markers and Lines. Also see Kuhfeld (2009) for more information about this macro.

You do not need to include autocall macros (for example, by specifying a %include statement). You can call them directly after they are properly installed. If your site has installed the autocall libraries that are supplied by the SAS System and uses the standard configuration of SAS software, you need to ensure that the SAS System option MAUTOSOURCE is in effect before you can begin using the autocall macros. For more information about autocall libraries, see the SAS Macro Language: Reference. For information about installing autocall macros, consult your host documentation.

The %ModStyle macro has the following options:


specifies a space-delimited list of colors for markers and lines. If you do not specify this option, then the colors from the parent style are used. You can specify the colors by using any SAS color notation, such as CXrrggbb.

COLORS=GRAYS generates seven distinguishable grayscale colors from blackest to whitest. The colors should be mixed up to be more easily distinguished when you need fewer colors, but you can do that in your own COLORS= list. The HLS (hue/light/saturation) coding generates colors by setting hue and saturation to 0 and incrementing the lightness for each gray. You can also use the keywords BLUES, PURPLES, MAGENTAS, REDS, ORANGES, YELLOWS, GREENS, and CYANS to generate seven colors that have a fixed hue and a saturation of AA (hex).

COLORS=SHADES INT generates seven colors as described previously, except that you specify an integer $0 \le \mbox{INT} < 360$. (See SAS/GRAPH: Reference.) The available hues are GRAY (or GREY), BLUE=0, PURPLE=30, MAGENTA=60, RED=120, ORANGE=150, YELLOW=180, GREEN=240, and CYAN=300.


specifies whether to display the generated template. By default, the template is not displayed. Specify DISPLAY=1 to display the generated template.


specifies a space-delimited list of colors for bands and fills. If you do not specify this option, then the colors from the parent style are used.

Fill colors from the parent style are designed to work well with the colors from the parent style. If you specify a COLORS= list, then you might also want to redefine the FILLCOLORS= list. You need to have at least as many fill colors as you have colors (any extra fill colors are ignored). Two shortcuts are available: FILLCOLORS=COLORS uses the COLORS= colors for the fills (your confidence bands should have transparency for this shortcut to be useful), and FILLCOLORS=LIGHTCOLORS modifies the lightness that is associated with each color generated by COLORS=SHADES (this is allowed only with COLORS=SHADES).


specifies a space-delimited list of line styles. The default is

LineStyles=Solid MediumDash MediumDashShortDash LongDash
           DashDashDot LongDashShortDash DashDotDot Dash
           ShortDashDot MediumDashDotDot ShortDash

Line style numbers can range from 1 to 46. Some line styles have names associated with them. You can specify either the name or the number for the following number/name pairs: 1 Solid, 2 ShortDash, 4 MediumDash, 5 LongDash, 8 MediumDashShortDash, 14 DashDashDot, 15 DashDotDot, 20 Dash, 26 LongDashShortDash, 34 Dot, 35 ThinDot, 41 ShortDashDot, and 42 MediumDashDotDot.


specifies a space-delimited list of marker symbols. By default, Markers=Circle Plus X Triangle Square Asterisk Diamond. The available marker symbols are listed in the SAS Graph Template Language: Reference. Two shortcuts are available: MARKERS=FILLED is an alias for the specification Markers=CircleFilled TriangleFilled SquareFilled DiamondFilled StarFilled HomeDownFilled, and MARKERS=EMPTY is an alias for the specification Markers=Circle Triangle Square Diamond Star HomeDown.


specifies the name of the new style that you are creating. This name is used when you specify the style in an ODS destination statement (for example, ODS HTML STYLE=style-name). By default, NAME=NEWSTYLE.


specifies n, the number of GraphDatan style elements to create. The GraphData1GraphDatan style elements contain n combinations of colors, markers, and line styles. By default, 32 combinations are created.


specifies the parent style. The new style inherits most of its attributes from the parent style. By default, PARENT=DEFAULT (which is the top-level parent style for all the styles that are recommended for statistical graphics). If your goal is to change colors or create an all-color style, you can use any style as the parent style. However, if your goal is to change markers or line styles without creating an all-color style, do not use ATTRPRIORITY="Color" style (such as HTMLBLUE, PEARL, PEARLJ, and SAPPHIRE) as a parent.


specifies how your new style cycles through colors, markers, and line styles. The values that are specified in the TYPE= option are case-sensitive ("by" is lowercase and the L, C, and M are uppercase). By default, TYPE=LMbyC.

These first three methods work well in all plots, because cycling line styles and markers together ensures that both scatter-plot markers and series plot lines are distinguishable:


cycles through colors, line styles, and markers simultaneously. The first group uses the first color, line style, and marker; the second group uses the second color, line style, and marker; and so on. This is the method that most styles use; it corresponds to ATTRPRIORITY="None".


fixes line style and marker, cycles through colors, and then moves to the next line style and marker. This is the default; it creates a style where the first groups are distinguished entirely by color, which corresponds to ATTRPRIORITY="Color".


fixes color, cycles through line style and marker, and then moves to the next color. This option uses the smaller of the number of line styles or the number of markers when cycling within a color.

The following two methods might not work well in all plots:


fixes color and line style, then cycles through markers, increments line style, and then cycles through markers again. After all line styles have been used, this option moves to the next color and continues.


fixes line style and marker, then cycles through colors, increments marker, and then cycles through colors again. After all markers have been used, this option moves to the next line style and continues. This is closest to the legacy SAS/GRAPH method.