SAS Institute. The Power to Know

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

Previous | Next
LAYOUT LATTICE Statement

Axis Statements

The axis statements can be used to simplify and clarify the layout by displaying only the external axes in the resulting graph.

The following figure shows the default layout with internal axes displayed:


latticeaxisinternal image


This next figure shows a simplified layout with only the external axes displayed:


latticeaxisexternal image


Axis statements are only useful if the data ranges across the affected columns or rows are comperable and can be unified to a common scale. For example, external axes are not supported if an affected lattice cell contains a LAYOUT OVERLAYEQUATED statement.

To unify column data ranges, use the COLUMNDATARANGE= option. To unify row data ranges, use the ROWDATARANGE= option. If the axis ranges are not unified for the affected columns or rows, the axis statements in the layout are ignored.

External X axes (top and/or bottom) for columns are specified within a COLUMNAXES block, nesting one or more COLUMAXIS statements within the block. If a lattice cell contains a LAYOUT OVERLAY with the XAXISOPTS= option specified, the XAXISOPTS= option is ignored. In such cases, the desired axis features should be specified on the COLUMNAXIS statement. An X2AXISOPTS= option is also ignored if specified on the OVERLAY.

External Y axes (left and/or right) for rows are specified within a ROWAXES block, nesting one or more ROWAXIS statements within the block. If a lattice cell contains a LAYOUT OVERLAY with the YAXISOPTS= option specified, the YAXISOPTS= option is ignored. In such cases, the desired axis features should be specified on the ROWAXIS statement. A Y2AXISOPTS= option is also ignored if specified on the OVERLAY.

The axis statements have the following general syntax:

COLUMNAXES ;

           COLUMNAXIS / axis-option(s);

           <...COLUMNAXIS-n;>

ENDCOLUMNAXES ;

ROWAXES ;

           ROWAXIS / axis-option(s);

           <...ROWAXIS-n;>

ENDROWAXES ;
  • Only one COLUMNAXES block can be used in the LATTICE layout block. If more than one is specified, only the last one is used.
  • Within a COLUMNAXES block, the number of COLUMNAXIS statements should match the number of columns.
  • Only one ROWAXES block can be used in the LATTICE layout block. If more than one is specified, only the last one is used.
  • Within a ROWAXES block, the number of ROWAXIS statements should match the number of rows.
  • If the number COLUMNLAXIS or ROWAXIS statements is greater than the number needed, the extra statements are ignored. If the number of statements is fewer than the number needed, the additionl COLUMNAXIS or ROWAXIS statements are automatically generated with DISPLAY=NONE options in effect.

For the list of axis-options , see Chapter 43, "Axis Options for LAYOUT LATTICE."

The following example shows a LAYOUT LATTICE block that uses a ROWAXES block to set external axes and display gridlines for the row display.

  
  begingraph; 
    layout lattice / 
       rowdatarange=union 
       columns=2; 
  
       /* axis definitions */ 
       rowaxes; 
          rowaxis /griddisplay=on; 
       endrowaxes; 
  
       /* cell contents */ 
       scatterplot x=x y=t; 
       scatterplot x=x y=y; 
  
    endlayout; 
  endgraph;
 

Here, the LAYOUT LATTICE statement specifies the ROWDATARANGE option to unify the data ranges across rows in the layout. Because LAYOUT LATTICE specifies COLUMNS=2 and there are two plot statements in the template, the resulting graph has two columns and only one row. Thus, only one ROWAXIS statement is needed in the ROWAXES block to specify axis attributes for that row of graphs.

Previous | Next | Top of Page