| TEMPLATE Procedure: Layout Statements (Experimental) |
| Overview of the Layout Statements |
You can use layout statements to specify the arrangement of the components of a graph. Layout statements are specified in a layout block that begins with a LAYOUT statement and ends with an ENDLAYOUT statement. Within a LAYOUT statement block, you can specify plot statements, text statements, and other layout statements to define one or more graph components. All of the statements that are within the layout block apply to that statement's layout area. Each statement can specify one or more options to modify the layout's appearance.
The three types of layouts are gridded, lattice, and overlay.
A gridded layout defines a grid of rows and columns that are populated with plots or text.You can use the the LAYOUT GRIDDED statement to specify any number of areas and arrange them in any way, mixing different sized areas in any arrangement. It is the most general layout statement and can achieve any layout arrangement. With the LAYOUT GRIDDED statement, you can do the following:
define an inset for a graph
display separate graphs
position text such as a title, footnote, or legend outside of the graph area
span and center a single text string, such as a title, over a set of grids
display multiple graphs when there is no need to scale the data ranges on the axes
provide numerous areas for presenting graphs and annotations
A lattice layout is a specialized form of a grid that always aligns areas in symmetrical arrangements. It is primarily used to display multiple graphs that are best viewed with a common data range along one or more axes, even when the data ranges may be different in the underlying data.
With lattice layouts you can:
define a grid of graphs where there is data subsetting and/or merging across rows or columns
automatically align column labels, row labels, and axis labels
automatically scale data ranges on the axes
The lattice layout makes it easy to simplify the graphical presentation by customizing the axis display across graphs. For example, if the Y-axis scale and values are the same for two graphs that are displayed side-by-side, it is easy to drop the display of ticks and values in the graph on the right, allowing the ticks and values in the graph on the left to apply to both Y-axes.
An overlay layout creates one graph area with one set of axes. One or more graphs can be added to this area. The graphs will be overlayed and share the same set of axes.
When nested within another layout type, LAYOUT OVERLAY statement block generally defines the graph display for one cell of the enclosing layout. A separate LAYOUT OVERLAY statement block is used for each cell.
The LAYOUT OVERLAY statement block is primarily used to specify plots, however, you can specify other ODS statistical graph statements. The resuts of any ODS statistical graph statement that you specify within the overlay layout are placed within the bounds of the axes data-display area.
Layout statements can be nested to achieve any possible layout. For example, a common technique is to nest an overlay layout within a gridded layout so that a title can be specified outside of the overlay area. You can nest text statements within the layout statements to achieve different positions for your text within the graphic display.
With layout statements you can do the following:
create an overlay layout that lets you specify a graph area with a single set of axes. Multiple plots and text entries can be overlayed within the area.
create a gridded layout that lets you control the placement of titles, footnotes, and graph areas for the display of multiple graphs.
create a lattice layout that automatically scales data ranges and customizes the axis display across graphs.
If you are using ODS Graphics for the first time, begin by reading the section about statistical graphics and ODS in SAS/STAT User's Guide, which illustrates the use of ODS Graphics, and provides general information on managing your graphics. Additional examples are given in the sections for procedures that use ODS Graphics in SAS 9.1.
Note: For definitions of terms used in this section, see Terminology.
| Values for ODS Statistical Graph Options |
The default value that is used for an option depends on the ODS statistical graph definition that is in use. The implementation of an option depends on the ODS destination that formats the output. In addition, if you are creating HTML output, the implementation of an attribute depends on the browser that you use.
Values for ods statistical graph options are often one of the following:
specifies a string value of an arrow shape, or a dynamic variable that contains an arrow shape, or a style reference to an arrow shape.
An arrow-list specifies a sequence of arrow shapes, or a column variable that contains arrow shapes, or a dynamic variable that refers to such a column variable or to a string.
Arrow Shapes
![[Arrow Shapes]](./images/arrowtablestatgraph.gif)
specifies a string value that is true or false, or a style reference to a boolean value.
A boolean-list specifies a sequence of boolean values, or a column variable that contains boolean value, or a dynamic variable that refers to such a column variable or to a string .
For all attributes that support a value of ON, the following forms are equivalent:
ATTRIBUTE-NAME ATTRIBUTE-NAME=ONFor all attributes that support a value of variable, variable can be any variable that you declare in the table definition with the DYNAMIC, MVAR, or NMVAR statement. If the attribute is a boolean, then the value of variable should resolve to either true or false. The following values represent a true or false value.
| True | False | |
|---|---|---|
| ON | OFF | |
| _ON_ | _OFF_ | |
| TRUE | FALSE | |
| YES | NO | |
| _YES_ | _NO_ | |
| 1 | 0 | |
is a string that identifies a color.
A color-list specifies a sequence of colors, or a column variable that contains colors, or a dynamic variable that refers to such a column variable or to a string.
A color can be
any of the color names that are supported by SAS/GRAPH. These names include
a predefined SAS color (for example, blue or VIYG)
a red/green/blue (RGB) value (for example, CX0023FF)
a hue/light/saturation (HLS) value (for example, H14E162D)
a gray-scale value (for example, GRAYBB).
an RGB value with a leading pound sign (#) rather than CX (for example, #0023FF).
one of the colors that exists in the SAS session when the style definition is used:
DMSBLUE
DMSRED
DMSPINK
DMSGREEN
DMSCYAN
DMSYELLOW
DMSWHITE
DMSORANGE
DMSBLACK
DMSMAGENTA
DMSGRAY
DMSBROWN
SYSBACK
SYSSECB
SYSFORE.
Note: Use these colors only if you are running SAS in the windowing environment.
an English description of an HLS. Such descriptions use a combination of words to describe the lightness, the saturation, and the hue (in that order). You can use the Color Naming System to form a color by
combining a chromatic hue with a lightness, a saturation, or both
combining the achromatic hue gray with a lightness
combining the achromatic hue black or white without qualifiers.
You can combine these words to form a wide variety of colors. Some examples are
light vivid green
dark vivid orange
light yellow.
Note: The Output Delivery system first tries to match a color with a SAS/GRAPH color. Thus, although brown and orange are interchangeable in the table, if you use them as unmodified hues, they are different. The reason for this is that ODS interprets them as SAS colors, which are mapped to different colors.
You can also specify hues that are intermediate between two neighboring colors. To do so, combine one of the following adjectives with one of its neighboring colors:
reddish
orangish
brownish
yellowish
greenish
bluish
purplish.
For example, you can use the following as hues:
bluish purple
reddish orange
yellowish green.
| See also: | SAS/GRAPH Reference, Volumes 1 and 2 for information about SAS/GRAPH colors. |
specifies a column variable that contains either double-precision values or string values, or a dynamic variable that refers to such a column variable.
A column-list specifies a sequence of column variables, or a column variable that contains column variables, or a dynamic variable that refers to such a column variable, or a dynamic variable that refers to a string containing a list of column variables. Values within the columns can be either double-percision or strings.
is a nonnegative number, optionally followed by one of the following units of measure:
| cm | centimeters |
| em | standard typesetting measurement unit for width |
| ex | standard typesetting measurement unit for height |
| in | inches |
| mm | millimeters |
| pt | a printer's point |
A dimension-list specifies a sequence of formats, or a column variable that contains formats, or a dynamic variable that refers to such a column variable or to a string.
| Default: | For the Printer destination, units of 1/150 of an inch |
A value can also be a font definition. A font definition has the following general format:
| ("font-face-1 <... , font-face-n>", font-size, keyword-list) |
font-size specifies the size of the font. font-size can be a dimension or a number without units of measure. If you specify a dimension, you must specify a unit of measure. Without a unit of measure the number becomes a size that is relative to all other font sizes in the document. See the discussion of dimensions.
keyword-list specifies the font weight, font style, and font width. You can include one value for each, in any order. The following table shows the keywords that you can use:
is a SAS format or a user-defined format.
A format-list specifies a sequence of formats, or a column variable that contains formats, or a dynamic variable that refers to such a column variable or to a string.
specifies a column variable that contains integer values, or a dynamic variable that refers to such a column variable.
An integer-listspecifies a sequence of integer values, or a column variable that contains integer values, or a dynamic variable that refers to such a column variable or to a string.
integer-column-list specifies a sequence of column variables, or a column variable that contains column variables, or a dynamic variable that refers to such a column variable, or a dynamic variable that refers to a string containing a list of column variables. Values within the columns must be integers.
specifies a string value of a line pattern, or a dynamic variable that contains such a string, or a style reference to a line pattern. Line patterns are chosen for discriminability. Because of different densities, equal weighting is impossible for lines of the same thickness. Instead, line patterns are ordered to provide a continuum of weights which is useful when displaying confidence bands.
A line-list specifies a sequence of line patterns, or a column variable that contains line patterns, or a dynamic variable that refers to such a column variable or to a string.
Line Patterns
![[Line Patterns]](./images/linetablestatgraph.gif)
specifies a string value of a maker symbol, or a dynamic variable that contains a marker symbol, or a style reference to a marker symbol.
A marker-list specifies a sequence of marker symbols, or a column variable that contains marker symbols, or a dynamic variable that refers to such a column variable or to a string, or one of the marker sets.
Marker Symbols
![[Marker Symbols]](./images/markertablestatgraph.gif)
Marker Symbol Sets
![[Marker Symbol Sets]](./images/markersymbolsetstatgraph.gif)
specifies a value, or a dynamic variable that contains a double-precision value, or an expression that resolves to a double-precision value, or a style reference to a double-precision value.
A numeric-list specifies a sequence of double-precision values, or a column variable that contains double-precision values, or a dynamic variable that refers to such a column variable or to a string.
A numeric-column specifies a column variable that contains double-precision values, or a dynamic variable that refers to such a column variable.
A numeric-column-list specifies a sequence of column variables, or a column variable that contains column variables, or a dynamic variable that refers to such a column variable, or a dynamic variable that refers to a string containing a list of column variables. Values within the columns must be double-precision.
is a quoted character string.
A string-list specifies a sequence of strings, or a column variable that contains strings, or a dynamic variable that refers to such a column variable or to a string .
A string-column specifies a column variable that contains string values, or a dynamic variable that refers to such a column variable.
A string-column-list specifies a sequence of column variables, or a column variable that contains column variables, or a dynamic variable that refers to such a column variable, or a dynamic variable that refers to a string containing a list of column variables. Values within the columns must be strings.
is a reference to an attribute that is defined in a style element.
In the ODS statistical graph definitions that SAS provides, options for plot features are specified with a style reference in the form style-element:attribute, rather than a specific value. For example, the symbol, color, and size of markers for a basic scatter plot is specified in a SCATTERPLOT statement as follows:
scatterplot x=X y=Y/ markersymbol=GraphDataDefault:markersymbol markercolor=GraphDataDefault:contrastcolor markersize=GraphDataDefault:markersizeThe above style-references guarantee a common appearance for markers used in all basic scatter plots, which is controlled by the GraphDataDefault style element in the style definition that you specify.
In order to create your own style definition, or to modify a style definition to use with ODS Graphics, you need to understand the relationship between style elements and graph features. For more information, see "ODS Statistical Graphics and ODS Styles: Usage and Reference (Experimental)" at http://support.sas.com/documentation/onlinedoc/base/.
Style definitions are created and modified with the TEMPLATE procedure. For more information, see the section about creating a style definition in SAS Output Delivery System: User's Guide.