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:
This next figure shows
a simplified layout with only the external axes displayed:
Axis statements are
useful only if the data ranges across the affected columns or rows
are comparable 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. If the axis ranges are not unified
for the affected columns or rows, the axis statements in the layout
are ignored.
To unify data ranges in
the layout grid, the following options are available:
Specifying Axis Features. For columns, axis features for the external X axes (bottom) are
specified within a COLUMNAXES block, nesting one COLUMNAXIS statement
for each column that contains an X axis that you need to manage. The
COLUMNAXIS statement provides a DISPLAYSECONDARY= option, which enables
you to display a secondary X (top) axis that mirrors the primary X
axis but can have different display features. In that case, the axis
features that you specify in the COLUMNAXIS statement apply to both
the primary and secondary X axes.
If one or more plots
within the template use the XAXIS= option to produce independent
X2 (top) axes, axis features for the external X2 axes (top) are specified
within a COLUMN2AXES block, nesting one COLUMNAXIS statement for each
column that contains an X2 axis that you need to manage. Within the
COLUMN2AXES block, the COLUMNAXIS statement’s DISPLAYSECONDARY=
option enables you to display a secondary X2 (bottom) axis that mirrors
the primary X2 axis but can have different display features. Here
again, the axis features that you specify in the COLUMNAXIS statement
apply to both the primary and secondary X2 axes.
Note: If you specify independent
X and X2 scales at the same time, the DISPLAYSECONDARY= option is
ignored in the COLUMNAXIS statement. This is true whether the COLUMNAXIS
statement is specified in a COLUMNAXES or COLUMN2AXES block.
For both the COLUMNAXES
and COLUMN2AXES blocks, if a lattice cell within the column contains
a LAYOUT OVERLAY with the XAXISOPTS= or X2AXISOPTS= option specified,
these OVERLAY options are ignored. In such cases, the desired axis
features should be specified in the COLUMNAXIS statement.
For rows, axis features
for the external Y axes (left) are specified within a ROWAXES block,
nesting one ROWAXIS statement for each row that contains a Y axis
that you need to manage. The ROWAXIS statement provides a DISPLAYSECONDARY=
option, which enables you to display a secondary Y (right) axis that
mirrors the primary Y axis but can have different display features.
In that case, the axis features that you specify in the ROWAXIS statement
apply to both the primary and secondary Y axes.
If one or more plots
within the template use the YAXIS= option to produce independent
Y2 (right) axes, axis features for the external Y2 axes (right) are
specified within a ROW2AXES block, nesting one ROWAXIS statement for
each row that contains a Y2 axis that you need to manage. Within the
ROW2AXES block, the ROWAXIS statement’s DISPLAYSECONDARY= option
enables you to display a secondary Y2 (left) axis that mirrors the
primary Y2 axis but can have different display features. Here again,
the axis features that you specify in the ROWAXIS statement apply
to both the primary and secondary Y2 axes.
Note: If you specify independent
Y and Y2 scales at the same time, the DISPLAYSECONDARY= option is
ignored in the ROWAXIS statement. This is true whether the ROWAXIS
statement is specified in a ROWAXES or ROW2AXES block.
For both the ROWAXES
and ROW2AXES blocks, if a lattice cell within the row contains a LAYOUT
OVERLAY with the YAXISOPTS= or Y2AXISOPTS= option specified, these
OVERLAY options are ignored. In such cases, the desired axis features
should be specified in the ROWAXIS statement.
Syntax and
Restrictions for Axis Statements. The axis-statement
blocks have the following general syntax:
COLUMNAXES;
COLUMNAXIS / axis-option(s);
<...COLUMNAXIS-n;>
ENDCOLUMNAXES;
|
COLUMN2AXES;
COLUMNAXIS / axis-option(s);
<...COLUMNAXIS-n;>
ENDCOLUMN2AXES;
|
ROWAXES;
ROWAXIS / axis-option(s);
<...ROWAXIS-n;>
ENDROWAXES;
|
ROW2AXES;
ROWAXIS / axis-option(s);
<...ROWAXIS-n;>
ENDROW2AXES;
|
In the LATTICE layout
block, the following restrictions apply:
-
If the LAYOUT LATTICE statement
sets the row or column data range to DATA, the corresponding axes
block is ignored. The data range must be set to UNION or UNIONALL
to externalize the axes.
-
Only one COLUMNAXES block can be
used to manage X axes, and only one COLUMN2AXES block can be used
to manage X2 axes. If more than one of either block is specified,
only the last one of that block type is used.
-
Within a COLUMNAXES or COLUMN2AXES
block, one COLUMNAXIS statement should be specified for each column
that contains axes that you need to manage. Both axes blocks can contain
a COLUMNAXIS statement for the same column. For example, to manage
the axes in the first column of the layout, the COLUMNAXES block can
contain a COLUMNAXIS statement that manages the column’s X
axes. The COLUMN2AXES block can contain a COLUMNAXIS statement that
manages the column’s X2 axes.
-
Only one ROWAXES block can be used
to manage Y axes, and only one ROWAXES block can be used to manage
Y2 axes. If more than one of either block is specified, only the last
one of that block type is used.
-
Within a ROWAXES or ROW2AXES block,
one ROWAXIS statement should be specified for each row that contains
axes that you need to manage. Both axes blocks can contain a ROWAXIS
statement for the same row. For example, to manage the axes in the
first row of the layout, the ROWAXES block can contain a ROWAXIS statement
that manages the row’s Y axes. The ROW2AXES block can contain
a ROWAXIS statement that manages the column’s Y2 axes.
-
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 additional COLUMNAXIS or ROWAXIS statements are automatically
generated with DISPLAY=NONE options in effect.
The following example
shows a LAYOUT LATTICE block that uses a ROWAXES block to set external
axes and display grid lines 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. A ROW2AXES block is not needed because neither SCATTERPLOT
statement in the template maps data to the Y2 axis.