| TEMPLATE Procedure: Layout Statements (Experimental) |
Like an ODS table, style, or tagset definition, an ODS statistical graph definition is specified within the PROC TEMPLATE statements. The ODS statistical graph definition begins with a DEFINE STATGRAPH statement and ends with an END statement.
The following example shows the structure of an ODS statistical graph definition and how to create a lattice layout of two subsetted plots whose axes share a common range and whose vertical axes display only one set of labels and values.
The LAYOUT LATTICE statement specifies two columns and specifies a gutter between them. The LAYOUT LATTICE will automatically scale data ranges on the vertical axes. However, the horizontal axes are in different columns, therefore their data ranges are not scaled by default. In this case the scaling is not needed because the data ranges are the same in the data.
The COLUMNHEADER statement block specifies titles for each column. The LAYOUT LATTICE statement will automatically center each title over its column and assign text features that are appropriate for titles.
The SIDEBAR statement block specifies the text "height" as the text to display in the bottom of the layout. By default, the text will automatically be centered between the two columns and will serve as a common label for the column axes. The LAYOUT OVERLAY statements that specify the graphs will then suppress the display of their X-axis labels so that the display is not cluttered with redundant information.
The ROWAXIS statement block specifies that a default axis style be used for the row axes. Tick marks, tick values, and a label will display for the vertical axes and will apply to both axes. The LAYOUT OVERLAY statements that specify the graphs will then suppress the display of their X-axis labels so that the display is not cluttered with redundant information.
The COLUMNAXIS statement block specifies tick marks and values for each column axis. The axes will not display axis labels. The alternative label for them has been specified in the SIDEBAR statement block.
Each LAYOUT OVERLAY statement specifies the YDISPLAY= and XDISPLAY= options to turn off the default display for the X and Y axes. This prevents the axis style specified by the LAYOUT OVERLAY statement to overwrite the axis style specified by the ROWAXIS and COLUMNAXIS blocks.
layout lattice / columns=2 columngutter="10"; columnheader; entrytitle "Gender=Male"; entrytitle "Gender=Female"; endcolumnheader; sidebar / bottom; entry "height"; endsidebar; rowaxis; axis; endrowaxis; columnaxis; axis / display=(ticks|values); axis / display=(ticks|values); endcolumnaxis; layout overlay / ydisplay=none xdisplay=none scatterplot y=mweight x=mheight; lineparm slope=mslope yintercept=mintercept; endlayout; layout overlay / ydisplay=none xdisplay=none scatterplot y=fweight x=fheight; lineparm slope=fslope yintercept=fintercept; endlayout; endlayout;
Plots whose Vertical Axes Display One Set of Labels and Values
![[Plots whose Vertical Axes Display One Set of Labels and Values]](./images/exploringlayout2.gif)