As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Is the legend in your SAS/GRAPH output telling the right story?

From sasCommunity
Jump to: navigation, search


When generating plots using the GPLOT procedure, a third variable, such as a treatment or dose group, is often used as a grouping variable. GPLOT automatically uses the values of this variable in the LEGEND, but very often the designers of the plots will want particular symbols, line types, and/or colors to be specified for the display of specific values of this variable. Of course consistency is important, and if the program is subsequently run on a subset of the original data, some values of this discrete variable may be absent in the subset. This can result in an inconsistent representation (symbol, line type, color) of a particular value of the variable in a series of plots.

This paper will present macro and non-macro solutions for producing plots with consistent attributes for each distinct value of the grouping variable, showing how to maintain this consistency regardless of the subset used. The paper will also explain how to generate a legend which will either display all values that exist in the data or only those that appear in the subset.

Online Materials

View the pdf for this paper.

Contact Info

Please check out my user page. You can also email me.