SAS Institute. The Power to Know

SAS/GRAPH(R) 9.2: Graph Template Language Reference

Previous | Next
Key Concepts

Display Attributes for Non-Grouped Data

Appendix B, "Display Attributes," documents the attribute settings that can be specified for the lines, data markers, text, or area fills in a plot. The defaults for these attributes are defined on style elements, but you can use attribute options on the plot statement to change the defaults.

For example, the LINEPARM statement provides a LINEATTRS= option that specifies the color, line pattern, or line thickness of the plot line. For non-grouped data, if you do not set a line pattern in your template, then the default line pattern for the plot is obtained from the GraphDataDefault:LineStyle style reference.

To change the default line pattern, a PATTERN= suboption on LINEATTRS= is available. Table 2.1 shows the most common line patterns available for the PATTERN= suboption.

Table 2.1: Common Line Patterns

namedpatterns image


  • the left column shows the names for the line patterns
  • the center column illustrates the type of line the name requests
  • the right column shows the SAS/GRAPH line-style numbers for the line patterns

"Available Line Patterns" provides the complete list of line patterns that can be used with the GTL.

In the following template definition, the LINEPARM statement's LINEATTRS= option overrides the default line pattern by specifying PATTERN=DASH:

  
 proc template; 
   define statgraph patternchange; 
     begingraph; 
       layout overlay; 
         scatterplot y=height x=weight; 
         lineparm yintercept=intercept  slope=slope / 
           lineattrs=(pattern=dash); 
       endlayout; 
     endgraph; 
   end;
 

Other display options can be managed the same way. For example, the SCATTERPLOT statement provides a MARKERATTRS= option that specifies the color, size, symbol, and weight of the plot data markers. For non-grouped data, if you do not set a marker symbol in your template, then the default marker symbol is obtained from the GraphDataDefault:MarkerSymbol style reference.

To change the default marker symbol, a SYMBOL= suboption on MARKERATTRS= is available. Table 2.2 shows the marker symbols available for the SYMBOL= suboption.

Table 2.2: Available Marker Symbols

markers image


In the following template definition, the SCATTERPLOT statement's MARKERATTRS= option overrides the default marker symbol by specifying SYMBOL=CIRCLEFILLED, which uses a filled circle to represent the data points.

  
 proc template; 
   define statgraph symbolchange; 
     begingraph; 
       layout overlay; 
         scatterplot y=height x=weight / 
           markerattrs=(symbol=circlefilled); 
       endlayout; 
     endgraph; 
   end;
 

Previous | Next | Top of Page