Statistical Graphics Using 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 sections Creating an All-Color Style and 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, with a %include statement). You can call them directly once they are properly installed. If your site has installed the autocall libraries 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 to begin using the autocall macros. For more information about autocall libraries, see the SAS Macro Language: Reference. For details about installing autocall macros, consult your host documentation.

The %ModStyle macro has the following options:

COLORS=color-list

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 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 with 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 with 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 include: GRAY, GREY, BLUE=0, PURPLE=30, MAGENTA=60, RED=120, ORANGE=150, YELLOW=180, GREEN=240, and CYAN=300.

DISPLAY=n

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

FILLCOLORS=color-list

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 want to redefine the FILLCOLORS= list as well. 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 to be useful) and FILLCOLORS=LIGHTCOLORS modifies the lightness associated with each color generated by COLORS=SHADES (this is allowed only with COLORS=SHADES).

LINESTYLES=line-style-list

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.

MARKERS=marker-list

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 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.

NAME=style-name

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). The default is NAME=NEWSTYLE.

NUMBEROFGROUPS=n

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.

PARENT=style-name

specifies the parent style. The new style inherits most of its attributes from the parent style. The default is PARENT=DEFAULT (which is one of the default styles for HTML and the parent style for all of the styles that are recommended for statistical graphics). If your goals are 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 the HTMLBLUE style as a parent. The HTMLBLUE style is an all-color style that is different from most other styles due to its use of the ATTRPRIORITY= style option.

TYPE=type-specification

specifies how your new style cycles through colors, markers, and line styles. The default is TYPE=LMbyC.

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

CLM

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 used by the ODS Graphics styles.

LMbyC

fixes line style and marker, cycles through colors, and then moves to the next line style and marker. This is the default and creates a style where the first groups are distinguished entirely by color.

CbyLM

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 with all plots:

CbyLbyM

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

LbyMbyC

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