Example Program and Statement Details

Example Graph

The following graph was generated by the Example Program:
Example Graph in Layout OverlayEquated

Example Program

proc template;
  define statgraph layoutoverlayequated;
    begingraph;
      entrytitle "Gas Mileage for GMC Models";
      layout overlayequated / equatetype=fit;   
        referenceline y=16.2 /
         curvelabel="City Average for Trucks/SUVs"
         curvelabellocation=inside
         curvelabelattrs=GraphReference;
        referenceline x=20.6 /
         curvelabel="Highway Average for Trucks/SUVs"
         curvelabellocation=inside
         curvelabelattrs=GraphReference;
        scatterplot x=mpg_highway y=mpg_city /
         datalabel=model;
      endlayout;
    endgraph;
  end;
run;
proc sgrender data=sashelp.cars
     template=layoutoverlayequated;
  where make="GMC";
run;

Statement Summary

The LAYOUT OVERLAYEQUATED statement is similar to the LAYOUT OVERLAY statement: it builds a composite using one or more GTL-statements. Similar to a LAYOUT OVERLAY, you can specify one or more 2-D plots within the layout, provided all plots can share the same type of axes. (Additional restrictions are discussed in a moment.) You can also specify one or more insets.
As an overlay-type layout, OVERLAYEQUATED has the same behavioral characteristics as an OVERLAY layout. It uses the same general logic for rendering the composite (see LAYOUT OVERLAY Statement for details), and its default axis characteristics are generally determined by the first specified plot, unless you use PRIMARY=TRUE on an alternative plot statement (see When Plots Share Data and a Common Axis).
OVERLAYEQUATED differs from OVERLAY in several ways. With OVERLAYEQUATED,
  • The axis type for both X and Y axes is always linear. Thus, plot types that have discrete or binned axes cannot be used within this layout (for example, BOXPLOT, BOXPLOTPARM, BARCHARTPARM, HISTOGRAM, and HISTOGRAMPARM).
  • For equal data intervals on both axes, the display distance is the same. For example, an interval of 2 on the X axis maps to the same display distance as an interval of 2 on the Y axis.
  • The aspect ratio of the plot display equals the aspect ratio of the plot data. In other words, a 45 degree slope in data is represented by a 45 degree slope in the display. The EQUATETYPE= option determines how the axes are drawn.
The following figure illustrates how a series plot might map differently when specified in an OVERLAYEQUATED layout versus an OVERLAY layout:
Comparison of Overlay and OverlayEquated Layouts
A LAYOUT OVERLAYEQUATED statement enables you to specify one or more of the following XY plots: SCATTERPLOT, SERIESPLOT, NEEDLEPLOT, STEPPLOT, VECTORPLOT, BANDPLOT, LOESSPLOT, REGRESSIONPLOT, PBSPLINEPLOT, and CONTOURPLOTPARM. As long as one of these plots is present, you can also add FRINGEPLOT, LINEPARM, MODELBAND, REFERENCELINE, DROPLINE, and insets as ENTRY, DISCRETELEGEND, and CONTINUOUSLEGEND.
From a data standpoint, this layout has only two independent axes, X and Y. If any plots within the layout block use an XAXIS=X2 or YAXIS=Y2 option, the option is ignored and the data are mapped to the X or Y axis. To display X2 and Y2 axes, use the DISPLAYSECONDARY= suboption of the XAXISOPTS= and YAXISOPTS= options.
If an OVERLAYEQUATED statement is nested in a LATTICE layout, some of the LATTICE’s alignment and external axis features are not supported on the OVERLAYEQUATED layout.

Options

Statement Option
Description
Specifies the color of the layout background.
Displays the border around the layout.
Specifies the properties of the border line.
Specifies one or more axis options to be applied to all displayed axes.
Specifies whether the default visual attributes of markers, lines, and fills in nested plot statements automatically change from plot to plot.
Specifies how to draw the axis area.
Specifies whether the layout background is opaque.
Specifies the amount of extra space that is added inside the layout border.
Specifies the fill color of the plot wall area.
Specifies whether the plot’s wall and wall outline are displayed.
Specifies one or more X axis options.
Specifies one or more Y axis options.
BACKGROUNDCOLOR=style-reference | color
specifies the color of the layout background.
Default: The GraphBackground:Color style reference.
style-element
A reference in the form style-element:style-attribute. Only the style-attribute named COLOR is used.
Interaction: OPAQUE=TRUE must be in effect for the color to be seen. By default, OPAQUE=FALSE.
BORDER=boolean
specifies whether a border is drawn around the layout.
Default: FALSE
BORDERATTRS=style-element | style-element (line-options) | (line-options)
specifies the attributes of the border line around the layout. See General Syntax for Attribute Options for the syntax on using a style-element and Line Options for available line-options.
Default: The GraphBorderLines style element.
Interaction: BORDER=TRUE must be set for this option to have any effect.
COMMONAXISOPTS= (common-equated-axis-options)
specifies one or more axis options to be applied to all displayed axes. For a list of options, see Options That Apply in Common to Both Equated Axes
Requirement: Axis options must be enclosed in parentheses and separated by spaces.
CYCLEATTRS=boolean
specifies whether the default visual attributes of markers, lines, and fills in nested plot statements automatically change from plot to plot. See Cycling Through Group Attributes in Overlaid Plots for more information.
Default: FALSE
FALSE
does not cycle the default visual attributes of multiple plots. For example, if you overlay three series plots, each series line has the same default visual properties.
TRUE
the system looks at the plots in the layout. It tries to use the GraphData1 - GraphDataN style elements to assign different visual properties to applicable plots (scatter plots and series plots and others). For example, if you overlay three series plots, the three series lines receive different default visual properties (line pattern and color). These default properties are determined by the next GraphDataN style element not already used. Some plots in the layout do not participate in the cycling (for example, reference lines and drop lines).
EQUATETYPE= FIT | SQUARE | EQUATE
specifies how to draw the axis area.
graphs with different equatetype settings
Default: FIT
FIT
X and Y axes have equal increments between tick values. The data ranges of both axes are compared to establish a common increment size. The axes might be of different lengths and have a different number of tick marks. Each axis represents its own data range. One axis might be extended to use available space in the plot area. If a TICKVALUELIST= or TICKVALUESEQUENCE= axis option is used on COMMONAXISOPTS=, it is ignored.
SQUARE
Both the X and Y axes have the same length and the same major tick values. The axis length and tick values are chosen so that the minimum and maximum of both X and Y appear in the range of values appearing on both axes.
EQUATE
Same as FIT except that neither axis is extended to use available space in the plot area.
OPAQUE= boolean
specifies whether the layout background is opaque (TRUE) or transparent (FALSE).
Default: FALSE
Interaction: When this option is set to FALSE, the background color is not used.
PAD=dimension | (pad-options)
specifies the amount of extra space that is added inside the layout border.
Default: The default padding for all sides is 0. Values without units are in pixels (px). A unit must be provided if other than pixels.
dimension
Specifies a dimension to use for the extra space at the left, right, top, and bottom of the layout border.
(pad-options)
Enables separate settings for the left, right, top, and bottom padding dimensions. Use the pad-options to create non-uniform padding. These options must be enclosed in parentheses. Each option is specified as a name = value pair. Sides not assigned padding are padded with the default amount.
Values without units are in pixels (px). A unit must be provided if other than pixels.
LEFT=dimension specifies the amount of extra space added to the left side.
RIGHT=dimension specifies the amount of extra space added to the right side.
TOP=dimension specifies the amount of extra space added to the top.
BOTTOM=dimension specifies the amount of extra space added to the bottom.
WALLCOLOR=style-reference | color
specifies the fill color of the plot wall area.
Default: The GraphWalls:Color style reference.
style-element
A reference in the form style-element:style-attribute. Only the style-attribute named COLOR is used.
Interaction: This option is ignored if WALLDISPLAY=NONE or WALLDISPLAY=(OUTLINE).
WALLDISPLAY= STANDARD | ALL | NONE | (display-options)
specifies whether the plot’s wall and wall outline are displayed.
Default: STANDARD
STANDARD
Displays a filled wall. The setting of the FRAMEBORDER= ON | OFF attribute of the GraphWalls style element determines whether the wall outline is displayed.
ALL
Displays a filled, outlined wall.
NONE
Displays no wall, no wall outline.
(display-options)
A list of options, enclosed in parentheses, that must include one of the following:
OUTLINE displays the wall outline.
FILL displays the plot wall.
Use the WALLCOLOR= option to control the fill color of the wall.
The appearance attributes of the wall outline are set by the GraphAxisLine style element.
XAXISOPTS= ( equated-axis-options )
specifies one or more X axis options. For a list of options, see Options That Apply Separately to an X or Y Equated Axis
Requirement: Axis options must be enclosed in parentheses and separated by spaces.
YAXISOPTS= ( equated-axis-options )
specifies one or more Y axis options. For a list of options, see Options That Apply Separately to an X or Y Equated Axis
Requirement: Axis options must be enclosed in parentheses and separated by spaces.