• Print  |
  • Feedback  |

TEMPLATE Procedure: Plot Statements (Experimental)

Plot Statements

CAUTION:
Creating ODS statistical graphics is an experimental feature that is available in Version 9.1. Do not use this part of the TEMPLATE procedure in production jobs.

Overview of the Plot Statements

The plot statements in an ODS statistical graph specify a number of commonly used displays. Plot statements can include band plots, bar charts, box plots, contour plots, density plots, histograms, line plots, needle plots, scatter plots, series plots, step plots, surface plots, and vector plots.

Plot statements must be specified inside a LAYOUT block. A LAYOUT block begins with a LAYOUT statement and ends with an ENDLAYOUT statement.

The plot statements can include options to specify which data columns from the source objects are used in the graph. For example, when creating a scatter plot, there are mandatory X= and Y= options that specify which data columns are used for the X and Y variables in the plot, and you can specify the GROUP= option to specify a data column as an optional classification variable.

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 of 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 one of the following:

arrow, arrow-list

specifies a string value of an arrow shape, 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, 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]

boolean, boolean-list

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, a column variable that contains boolean values, 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=ON
For all attributes that support a value of variable, variable can be any variable that you declare in the ODS statistical graph definition with the DYNAMIC, MVAR, or NMVAR statement. If the attribute is a boolean value, then the value of variable should resolve to either true or false. The following values represent a true or false value.
Boolean Values
True False
ON OFF
_ON_ _OFF_
TRUE FALSE
YES NO
_YES_ _NO_
1 0

color, color-list

is a string that identifies a color.

A color-list specifies a sequence of colors, 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 one of the following:

  • 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:

    DMSBLACK
    DMSCYAN
    DMSMAGENTA
    DMSRED
    SYSBACK

    Note:   Use the above colors only if you are running SAS in the windowing environment.

  • an English description of an Hue/Light/Saturation (HLS) value. 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 doing one of the following:

    • 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.

    The words that you can use are shown in the following table:
    HLS Values
    Lightness Saturation Chromatic Hue Achromatic Hue


    blue black *
    very dark grayish purple
    dark moderate red
    medium strong orange | brown gray **
    light vivid yellow
    very light
    green







    white *
    * Black and white cannot be combined with a lightness or a saturation value.

    ** Gray cannot be combined with a saturation value.

    You can combine these words to form a wide variety of colors. Some examples are the following:

    • 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. Because the ODS interprets these colors as SAS colors, they 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:

brownish
greenish
purplish
yellowish

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.
column, column-list

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, a column variable that contains column variables, 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-precision or strings.

dimension, dimension-list

is a nonnegative number, optionally followed by one of the following units of measure:

Units of Measure for Dimension
Unit Description
% percentage
PX pixels
PT point size, calculated at 100 dots per inch

A dimension-list specifies a sequence of formats a column variable that contains formats, or a dynamic variable that refers to such a column variable or to a string.

The default value for the Printer destination is units of 1/150 of an inch.

expression

specifies a selective, relational, or logical program structure that calculates values when those values are not stored in the data. The expression must be specified as an EVAL() argument. The following shows the structure of an EVAL() argument:

x = EVAL(expression)

The expression returns a number and can be formed with consonants, data columns, dynamic variables, functions, or other expressions. The following example uses the data column Time and the SGE functions MEAN and ACF:

EVAL( MEAN( Time ) + ACF( Time, NLags=10 ))

For more information of expressions, see Expressions.

format, format-list

is a SAS format or a user-defined format.

A format-list specifies a sequence of formats, a column variable that contains formats, or a dynamic variable that refers to such a column variable or to a string.

integer, integer-column, integer-list, integer-column-list

specifies a member of the set of positive whole numbers, negative whole numbers, and zero.

An integer-column specifies a column variable that contains integer values, or a dynamic variable that refers to such a column variable.

An integer-list specifies a sequence of integer values, a column variable that contains integer values, or a dynamic variable that refers to such a column variable or to a string.

An integer-column-list specifies a sequence of column variables, a column variable that contains column variables, 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.

line, line-list

specifies a string value of a line pattern, 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, 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]

marker, marker-list

specifies a string value of a maker symbol, 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, a column variable that contains marker symbols, a dynamic variable that refers to such a column variable or to a string, or one of the marker symbol sets.

Marker Symbols

[Marker Symbols]

Marker Symbol Sets

[Marker Symbol Sets]

number, numeric-list, numeric-column, numeric-column-list

specifies a value, a dynamic variable that contains a double-precision value, 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, a column variable that contains double-precision values, 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, a column variable that contains column variables, 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.

'string, string-list, string-column, string-column-list'

is a quoted character string.

A string-list specifies a sequence of strings, 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, a column variable that contains column variables, 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.

style-reference

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:markersize
The 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.


Previous Page | Next Page | Top of Page