PharmaSUG 2020 - Paper DV-006
What's Your Favorite Color?
Controlling the Appearance of a Graph
Richann Watson, DataRich Consulting
ABSTRACT
The appearance of a graph produced by the Graph Template Language (GTL) is controlled
by Output Delivery System (ODS) style elements. These elements include fonts and line and
marker properties as well as colors. A number of procedures, including the Statistical
Graphics (SG) procedures, produce graphics using a specific ODS style template. This paper
provides a very basic background of the different style templates and the elements
associated with the style templates. However, sometimes the default style associated with a
particular destination does not produce the desired appearance. Instead of using the default
style, you can control which style is used by indicating the desired style on the ODS
destination statement. However, sometimes not a single one of the 50-plus styles provided
by SAS® achieves the desired look. Luckily, you can modify an ODS style template to meet
your own needs. One such style modification is to control which colors are used in the
graph. Different approaches to modifying a style template to specify colors used are
discussed in depth in this paper.
INTRODUCTION
The appearance of many SAS-generated visualizations is controlled by ODS style elements.
There are over 50 different ODS styles that can be used for ODS statistical graphics. These
styles determine things such as the font, background color, the wall color, grouping color,
and contrasting color, just to name a few. Each ODS destination has a default style
associated with it. However, sometimes the default styles do not meet our needs. We may
have a client that wants things in black and white but with a specific font, so using the
standard colors associated with a style that utilizes that font may not be feasible. Or we
may need to have a consistent set of colors for specific values, thus allowing SAS to set the
colors may not be ideal. Because companies or individuals have different views on what
they deem as an ideal look for a graph, SAS allows for customization of styles. You can
write your own style, or you can start with a style that has most of the components you like
and modify that style to fit your needs. This paper will focus on taking existing styles and
modifying specific elements to create the desired look within GTL. However, these concepts
can be applied to other types of visualizations.
UNDERSTANDING ODS STYLES AND ELEMENTS
Before you can write your own style, it is advisable to have a basic understanding of the
different styles and some of the elements associated with styles. In this paper, we will
touch briefly on some of the different style elements, with the primary focus being adjusting
the colors.
DEFAULT STYLES AND COMMON ODS STYLES
For each device and ODS destination, SAS has default styles. For example, the default style
for the PDF destination is the “Pearl” style template, and the default style for the RTF
destination is the “RTF” style template (Figures 1 and 2).