SAS Institute. The Power to Know

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

Previous | Next
Key Concepts

Cycling Through Group Attributes in Overlayed Plots

Overlay-type layouts provide the CYCLEATTRS= options that specifies whether the default visual attributes of lines, marker symbols, and area fills in nested plot statements automatically change from plot to plot. When CYCLEATTRS=TRUE, all applicable plot statements (SCATTERPLOT, SERIESPLOT, and others) are sequentially assigned the next unused GraphDataN style element unless the plot statement has an explicit setting, either through a style element assignment or option settings. No plot retains its default (implicit) style element.

In the following example, assuming ungrouped data, the series plots are assigned line properties based on the GraphData1, GraphData2, and GraphData3 style elements. The reference line uses GraphReference, not GraphData4.

  
 layout overlay / cycleattrs=true; 
   seriesplot x=date y=var1; 
   seriesplot x=date y=var2; 
   seriesplot x=date y=var3; 
   referenceline x=cutoff / lineattrs=GraphReference; 
 endlayout;
 

If one of the plots in this example uses grouped data, the grouped plots also participate in the default cycles. For example, if the second plot has three groups, it generates three plots, which are assigned line properties based on the GraphData2, GraphData3, and GraphData4 style elements.

If the plot statement that uses grouped data also uses the INDEX= option to manage the group values (see "Remapping Groups for Grouped Data"), the INDEX= option overrides the default behavior. In that case, the grouped plots do not participate in the default cycling.

When one or more of the plots within the layout override the default cycling behavior, the arrangement of the plots within the layout may affect the default mapping of the GraphDataN elements to those statements that participate in the default cycling.

Previous | Next | Top of Page