GPLOT Procedure

PLOT Statement

Creates plots in which one variable is plotted on the horizontal axis and a second variable is plotted on the left vertical axis.
Requirement: At least one plot request is required.
Global statements: AXIS, FOOTNOTE, LEGEND, PATTERN, SYMBOL, TITLE
Supports: Drill-down functionality

Syntax

PLOT plot-request(s) </option(s)>;

Summary of Optional Arguments

Appearance options
specifies a data set to annotate all graphs that are produced by the GPLOT procedure.
specifies the color for the axis line and all major and minor tick marks.
fills the axis area with the specified color.
specifies the color of the outline that is drawn around filled areas.
specifies a color for all text on the axes and legend, including axis labels, tick mark values, legend labels, and legend value descriptions.
specifies whether a line is drawn around the axis area.
specifies that reference lines drawn by the AUTOREF or REF= options should be drawn in front of the bars.
identifies the image file that you want to apply to the axis area of the plot.
specifies whether to use multiple instances of the image to fill the axis area (TILE) or to stretch a single instance of the image to fill the (FIT). The TILE value is the default.
suppresses the axes, including axis lines, axis labels, all major and minor tick marks, and tick mark values.
Catalog options
specifies a description of the output.
specifies the name of the GRSEG catalog entry and the name of the graphics output file, if one is created.
Horizontal axis options
draws reference lines at all major tick marks on the horizontal axis.
specifies colors for reference lines drawn at major tick marks on the horizontal axis, as specified by the AUTOHREF option.
specifies the color of reference lines drawn perpendicular to the horizontal axis.
specifies major tick mark values for the horizontal axis or assigns an axis definition.
specifies the number of minor tick marks drawn between each major tick mark on the horizontal axis.
draws one or more reference lines perpendicular to the horizontal axis at points that are specified by value-list.
specifies that the order of the values on the horizontal axis be reversed.
specifies that tick marks on the horizontal axis begin in the first position with a value of zero.
specifies a line type for reference lines drawn at major tick marks on the horizontal axis, as specified by the AUTOHREF option.
specifies line types for reference lines drawn perpendicular to the horizontal axis.
specifies the line width for all reference lines at major tick marks on the horizontal axis as determined by the AUTOHREF option.
specifies line widths for reference lines as determined by the horizontal axis.
ODS options
identifies the variable in the input data set whose values create links.
identifies the variable in the input data set whose values create links or data tips or both.
specifies a character variable whose values are URLs.
Plot options
fills all the areas below plot line n with a pattern.
draws reference lines at all major tick marks on both axes.
generates a legend or specifies the legend to use for the plot.
removes the last area of a plot when the value specified by the AREAS= option exceeds the number of bounded areas in the plot.
suppresses the legend that is generated by a plot request of the type y-variable*x-variable=third-variable.
places all the plots that are generated by the PLOT statement on one set of axes.
displays the regression equation that is specified in the INTERPOL= option of the SYMBOL statement in the lower left corner of the plot.
breaks a plot line or an area fill at occurrences of missing values of the Y variable.
Vertical axis options
draws reference lines at all of the major tick marks on the vertical axis.
specifies the color of reference lines drawn at major tick marks on the vertical axis, as determined by the AUTOVREF option.
specifies the color of reference lines drawn perpendicular to the vertical axis.
specifies a line type for reference lines drawn at major tick marks on the vertical axis, as specified by the AUTOVREF option.
specifies the type of reference lines drawn with the AUTOVREF, VREF, and GRID options.
specifies the major tick mark values for the vertical axis or assigns an axis definition.
specifies the number of minor tick marks that are drawn between each major tick mark on the vertical axis.
draws one or more reference lines perpendicular to the vertical axis at specified points.
specifies that the order of the values on the vertical axis be reversed.
specifies that tick marks on the vertical axis begin in the first position with a zero.
specifies the line width for all reference lines at major tick marks on the vertical axis as determined by the AUTOVREF option.
specifies line widths for reference lines as determined by the vertical axis.

Required Argument

plot-request(s)
each specifies the variables to plot and produces a separate graph, unless you specify OVERLAY. All variables must be in the input data set. Multiple plot requests are separated with blanks. You can plot character or numeric variables. A plot request can be any of these:
y-variable*x-variable<=n>
plots the values of two variables and can assign a SYMBOL definition to the plot.
y-variable
variable plotted on the left vertical axis.
x-variable
variable plotted on the horizontal axis.
n
number of the nth generated SYMBOL definition.
Note:The nth generated SYMBOL definition is not necessarily the same as the nth SYMBOL statement. Plot requests of the form y-variable*x-variable=n assign the SYMBOL definition that is designated by n to the plot that is produced by y-variable*x-variable. For more information, see About Plot Requests That Assign a SYMBOL Definition.
(y-variable(s))*(x-variable(s))
plots the values of two or more variables and produces a separate graph for each combination of Y and X variables. That is, each Y*X pair is plotted on a separate set of axes unless you specify OVERLAY.
y-variable(s)
variables plotted on the left vertical axes.
x-variable(s)
variables plotted on the horizontal axes.
If you use only one y-variable or only one x-variable, omit the parentheses for that variable, for example:
plot (temp rain)*month;
This plot request produces two plots, one of TEMP and MONTH and one of RAIN and MONTH.
y-variable*x-variable=third-variable
plots the values of two variables against a third classification variable
y-variable
variable plotted on the left vertical axis.
x-variable
variable plotted on the horizontal axis.
third-variable
classification variable against which y-variable and x-variable are plotted. Third-variable can be character or numeric, but numeric variables should contain discrete rather than continuous values, or should be formatted to provide discrete values.
A separate plot (set of data points) is produced for each unique value of third-variable. That is, all plots are drawn on the same set of axes, and a legend is automatically generated to show the plot symbol and color for each value of the classification variable.
The following plot request produces a graph with a plot line for each department and a legend that shows the plot symbol for each department:
plot sales*weekday=dept;
For an example of a plot that specifies a third-variable, see Plotting Three Variables.
Note:If a BY statement is used to produce multiple plots, you can make the legend identical across graphs by specifying the UNIFORM option in the PROC GPLOT statement.
You can use more than one type of plot request in a single PLOT statement (provided that you do not specify OVERLAY), for example:
plot temp*month rain*month=2;

Optional Arguments

Options in a PLOT statement affect all graphs that are produced by that statement. You can specify as many options as you want and list them in any order.

ANNOTATE=Annotate-data-set
specifies a data set to annotate all graphs that are produced by the GPLOT procedure. To annotate individual graphs created using a By statement or multiple action statements, use ANNOTATE= in the action statement.
Alias:ANNO=
AREAS=n
fills all the areas below plot line n with a pattern. The value of n specifies which areas to fill:
  • AREAS=1 fills the first area.
  • AREAS=2 fills both the first and second areas, and so on.
If you specify a value for the AREAS= option that is greater than the number of bounded areas in the plot, the area between the top plot line and the axis frame is filled.
Before an area can be filled, the data points that border the area must be joined by a line. Use a SYMBOL statement with one of these interpolation methods to join the data points:
  • INTERPOL=JOIN
  • INTERPOL=STEP
  • INTERPOL=Rseries
  • INTERPOL=SPLINE | SM | L
See the SYMBOL Statement for details about interpolation methods.
By default, the AREAS= option fills areas by rotating a solid fill through the list of colors defined in the current style. If the NOGSTYLE option is specified, the areas are filled by rotating a solid fill through the device's color list. If the graph needs more patterns, it rotates hatch patterns, beginning with the M2N0 pattern. See the PATTERN Statement for more information about map and plot patterns. However, if color is limited to a single color with the CPATTERN= or COLORS= graphic options, the solid pattern is skipped and the first default pattern is M2N0. If the COLORS= graphic option specifies a single color, use as many SYMBOL statements as you have areas to fill because the INTERPOL= setting does not automatically apply to multiple symbol definitions.
You can alter the default pattern behavior by specifying patterns and colors on PATTERN statements that specify map and plot patterns. A separate PATTERN definition is needed for each specified area.
If you specify the PATTERN statements, the AREAS= option uses the lowest numbered PATTERN statement first. If it runs out of patterns, it uses the default behavior for map and plot patterns. See the PATTERN Statement for details.
Pattern definitions are assigned to the areas below the plot lines in the order the plots are drawn. The first area is that between the horizontal axis and the plot line that is drawn first. The second area is that above the first plot line and below the plot line that is drawn second, and so on. If the line that is drawn second lies below the line that is drawn first, the second area is hidden when the first is filled. The plots with the lower line values must be drawn first to prevent one area fill from overlaying another. If the lines cross, only the part of an area that is above the previous line is visible.
Therefore, when creating multiple plots in combination with the OVERLAY option, the PLOT statements must be ordered so that the plot request that produces the lowest line value is first (leftmost), the plot request that produces the next lowest line value is second plot request, and so on.
If you produce multiple plots with a y-variable*x-variable=third-variable plot request, the lines are plotted in order of increasing third variable values. In that case, you must recode your data so that the lowest value of the third variable produces the lowest plot line, the next lowest value produces the next lowest plot line, and so on.
If you use the VALUE= option in the SYMBOL statement, some symbols might be hidden. If you also specify reference lines with the AREAS= option, they are drawn behind the pattern fill.
If you use the AREAS= option to fill the areas between your plots and you use the JAVA device to generate the plot, when you move your mouse pointer over a filled area in the plot output, a tooltip shows the values for the last observation in the data set for the group that the area represents. However, when you position your mouse pointer over a data point on a plot line, a tooltip shows the value for that point. This might confuse your viewers. To help avoid confusion in that case, you can turn off the tooltips by specifying the following on your ODS statement:
parameters=("Tips"="NONE")
Restriction:Partially supported by Java
Notes:The AREAS= option works only if all plot lines are generated by the same PLOT or PLOT2 statement.

If you have specified the NOGSTYLE option and the first color in your device's default color list is black, color rotation begins with the second color in the list. That is, there are no solid black patterns. See How Default Patterns and Outlines Are Generated for more information.

AUTOHREF
draws reference lines at all major tick marks on the horizontal axis. If the AREAS= option is also used, the filled areas cover the reference lines. To draw lines on top of the filled areas, use the FRONTREF option. LAUTOHREF=, CAUTOHREF=, and WAUTOHREF= options can be used to change the line types, colors, and widths of these reference lines. To specify labels for these reference lines, use the HAXIS= option.
AUTOVREF
draws reference lines at all of the major tick marks on the vertical axis. If you also use the AREAS= option, the filled areas cover the reference lines. To draw lines on top of the filled areas, use the FRONTREF option in either the PROC GPLOT statement or the PLOT statement. LAUTOVREF=, CAUTOVREF=, and WAUTOVREF= options can be used to change the line types, colors, and widths of these reference lines. To specify labels for these reference lines, use the VAXIS= option.
CAUTOHREF=reference-line-color
specifies colors for reference lines drawn at major tick marks on the horizontal axis, as specified by the AUTOHREF option. The default color is either the value of the CAXIS= option or the first color in the color list.
CAUTOVREF=reference-line-color
specifies the color of reference lines drawn at major tick marks on the vertical axis, as determined by the AUTOVREF option. If you do not specify the CAUTOVREF option, the default color is the value of the CAXIS= option. If neither option is specified, the default color is retrieved from the current style or from the device's color list if the NOGSTYLE option is specified.
CAXIS=axis-color
specifies the color for the axis line and all major and minor tick marks. The default color is retrieved from the current style or from the device's color list if the NOGSTYLE option is specified.
Alias:CA=
CFRAME=background-color
fills the axis area with the specified color. If the FRAME option is also in effect, the procedure determines the color of the frame around the axis area according to the precedence list given within the FRAME option description.
Style reference:Color attribute of the GraphWalls element
Restriction:CFRAME= is overridden by the NOFRAME and IFRAME= options. If the IFRAME= option is in effect, an image appears in the axis area instead of the color.
CHREF=reference-line-color | (reference-line-color) | (reference-line-color-list)
specifies the color of reference lines drawn perpendicular to the horizontal axis. This option affects reference lines drawn with the AUTOHREF, HREF, and GRID options. Specifying a single color without parentheses applies that color to all reference lines. The CAUTOHREF= option overrides the CHREF= option for reference lines drawn with the AUTOHREF option. Specifying a single color in parentheses applies that color only to the first reference line drawn with the HREF= option. Specifying a color list applies colors sequentially to successive reference lines drawn with the HREF= option. The syntax of the color list requires parentheses and colors separated by spaces (color1 color2 ...colorN). If you do not specify the CHREF= option, the GPLOT procedure uses the color specified by the CAXIS= option. If neither option is specified, the default color is retrieved from the current style of from the first color in the color list if the NOGSTYLE option is specified.
Alias:CH=
Style reference:Color attribute of the GraphGridLines element
COUTLINE=outline-color
specifies the color of the outline that is drawn around filled areas. The filled areas are generated when the SYMBOL statement specifies INTERPOL=map/plot-pattern or the GOPTIONS statement specifies INTERPOL. The default outline color is specified in the current style. However, if the NOGSTYLE option is specified, then the default color is the first color in the device's color list (the foreground color), and the default slice outline color is determined as follows:
  • If you do not specify a PATTERN statement, the default outline color is the color defined in the current style.
  • If you specify the NOGSTYLE option and no PATTERN statement, the default outline color is black for the Java or ActiveX devices. Otherwise, the default outline color is the foreground color. If you specify an EMPTY PATTERN statement, then the default outline color is the same as the fill color.
The COUTLINE= option overrides the SYMBOL statement option CO=.
Style reference:Color attribute of the GraphOutlines element
Restriction:Not supported by Java
CTEXT=text-color
specifies a color for all text on the axes and legend, including axis labels, tick mark values, legend labels, and legend value descriptions. The GPLOT procedure searches for a color specification in this order:
  1. colors specified for labels and values on assigned AXIS and LEGEND statements, which override the CTEXT= option specified in the PLOT statement
  2. the color specified by the CTEXT= option in the PLOT statement
  3. the color specified by the CTEXT= option in the GOPTIONS statement
  4. the color specified in the current style, or, if the NOGSTYLE option is specified, then the default color is black for the Java and ActiveX devices and the first color in the color list for all other devices
The LEGEND statement's VALUE= color is used for legend values, and its LABEL= color is used for legend labels.
The AXIS statement's VALUE= color is used for axis values, and its LABEL= color is used for axis labels. However, if the AXIS statement specifies only general axis colors with its COLOR= option, the CTEXT= color overrides the general COLOR= specification and is used for axis labels and values. The COLOR= color is still used for all other axis colors, such as tick marks.
Alias:C=
Style reference:Color attributes of the GraphValueText and the GraphLabelText elements
Note:If you use a BY statement in the procedure, the color of the BY variable labels is controlled by the CBY= option in the GOPTIONS statement.
CVREF=reference-line-color | (reference-line-color) | (reference-line-color-list)
specifies the color of reference lines drawn perpendicular to the vertical axis. This option affects reference lines drawn with the AUTOVREF, VREF, and GRID options. Specifying a single color without parentheses applies that color to all reference lines. The CAUTOVREF= option overrides the CVREF= option for lines drawn with the AUTOVREF option. Specifying a single color in parentheses applies that color only to the first reference line drawn with the VREF= option. Specifying a color list applies colors sequentially to successive reference lines drawn with the VREF= option. The syntax of the color list requires parentheses and colors separated by spaces (color1 color2... colorN). If you do not specify the CVREF= option, the GPLOT procedure uses the color specified by the CAXIS= option. If neither option is specified, the default color is retrieved from the current style of from the first color in the color list if the NOGSTYLE option is specified.
Alias:CV=
Style reference:Color attribute of the GraphGridLines element
DESCRIPTION=“description
specifies a description of the output. The maximum length for description is 256 characters. The description does not appear in the output. The descriptive text is shown in each of the following:
  • the chart description for Web output (depending on the device driver). See Chart Descriptions for Web Presentations for more information.
  • the Table of Contents that is generated when you use the CONTENTS= option on an ODS HTML statement, assuming that the output is generated while the contents page is open.
  • the description and the properties for the output in the Results window.
  • the description and properties for the catalog entry in the Explorer.
  • the Description field of the PROC GREPLAY window.
The description can include the #BYLINE, #BYVAL, and #BYVAR substitution options, which work as they do when used on TITLE, FOOTNOTE, and NOTE statements. Refer to Substituting BY Line Values in a Text String. The 256-character limit applies before the substitution takes place for these options. Thus, if in the SAS program the description text exceeds 256 characters, it is truncated to 256 characters, and then the substitution is performed.
Alias:DES=
Default:Based on whether a SYMBOL definition < =n> is specified in the plot request, either PLOT OF chart-variable by chart-variable or PLOT OF chart-variable by chart-variable identified by chart-variable
FRAME | NOFRAME
specifies whether a line is drawn around the axis area. The default is FRAME. If you also use a BUBBLE2 or PLOT2 statement and these plotting statements have conflicting frame specifications, FRAME is used as opposed to NOFRAME.
For the frame color, a specification is searched for in this order:
  1. the CAXIS= option
  2. the COLOR= option in the AXIS definition assigned to the vertical axis
  3. the COLOR= option in the AXIS definition assigned to the horizontal axis
  4. the default, which is the color defined by the current style
To fill the axis area with a color, use the CFRAME= option.
To fill the axis area with an image, use the IFRAME= option.
Alias:FR | NOFR=
FRONTREF
specifies that reference lines drawn by the AUTOREF or REF= options should be drawn in front of the bars. By default, reference lines are drawn on the back plane of the axis.
GRID
draws reference lines at all major tick marks on both axes. The line color is the color of the axis. When specified in a PLOT2 statement, the reference lines are drawn on the vertical axis on the right side of the plot.
HAXIS=value-list | AXIS<1 . . . 99>
specifies major tick mark values for the horizontal axis or assigns an axis definition. By default, the procedure scales the axis and provides an appropriate number of tick marks. To assign labels to horizontal reference lines, use an axis definition that contains the REFLABEL= option. The labels are applied in sequence to all reference lines defined with the AUTOHREF and HREF= options.
The way you specify value-list depends on the type of variable:
  • For numeric variables, value-list is either an explicit list of values, or a starting and an ending value with an interval increment, or a combination of both forms:
    • n <...n>
    • n TO n <BY increment>
    • n <...n> TO n <BY increment > <n <...n> >
    If a numeric variable has an associated format, the specified values must be the unformatted values.
  • For date-time values, value-list includes any SAS date, time, or datetime value described for the SAS functions INTCK and INTNX, shown here as SAS-value:
    • 'SAS-value'i < ...'SAS-value'i>
    • 'SAS-value'i TO 'SAS-value' i<BY interval>
  • For character variables, value-list is a list of unique character values enclosed in quotation marks and separated by blanks:
    • 'value-1' < ...'value-n'>
    If a character variable has an associated format, the specified values must be the formatted values.
    You are able to specify up to 256 characters for each variable value.
For a complete description of value-list, see ORDER=(value-list ) in the AXIS statement.
If data values fall outside of the range that is specified by the HAXIS= option, then by default the outlying data values are not used in interpolation calculations. See About the Input Data Set for more information about values out of range.
For Web output that is generated with a Java or ActiveX device driver, certain options of the AXIS statement are not supported. For details, see the AXIS Statement.
Restriction:Partially supported by Java and ActiveX
HMINOR=number-of-minor-ticks
specifies the number of minor tick marks drawn between each major tick mark on the horizontal axis. Minor tick marks are not labeled. The HMINOR= option overrides the NUMBER= suboption of the MINOR= option in an AXIS definition. You must specify a positive number.
HREF=value | (value) | (value-list)
draws one or more reference lines perpendicular to the horizontal axis at points that are specified by value-list. For a description of value-list see HAXIS=value-list | AXIS<1 . . . 99> for the PLOT statement. To specify labels for these reference lines, use the HAXIS= option.
Values can be listed in any order, but should be within the range of values represented by the chart response axis. A warning is written to the SAS log if any of the points are off of the axis, and no reference line is drawn for such points. You can use the AUTOREF option to draw reference lines automatically at all of the major tick marks
If the AREAS= option is also used, the filled areas cover the reference lines. To draw lines on top of the filled areas, use the FRONTREF option.
The LHREF=, CHREF=, and WHREF= options can be used to change the line types, colors, and widths of these reference lines.
HREVERSE
specifies that the order of the values on the horizontal axis be reversed. For Web output that is generated with a Java device driver, the horizontal axis data must be numeric. To specify line widths for these reference lines, use the WAUTOHREF= option.
Restriction:Partially supported by Java and ActiveX
HTML=variable
identifies the variable in the input data set whose values create links or data tips or both. The variable values are either links or data tips or both that are created in the HTML file generated by the ODS statement. The links are URLs pointing to Web pages to display when the user clicks (drills down) on elements in the graph. Data tips are detailed information or data values that are displayed as pop-up text when a mouse pointer is positioned over elements in the graph.
For Java and ActiveX, the PLOT statement is partially supported by the JAVA and ACTIVEX devices, and fully supported by the JAVAIMG and ACTXIMG devices, and the PLOT2 statement is supported only by the ACTXIMG device.
HTML_LEGEND=variable
identifies the variable in the input data set whose values create links. Input data set variable values create links that are associated with a legend value and point to the URL to display when the user clicks (drills down) on the value.
HZERO
specifies that tick marks on the horizontal axis begin in the first position with a value of zero. The HZERO request is ignored if negative values are present for the horizontal variable or if the horizontal axis has been specified with the HAXIS= option.
IFRAME=fileref | 'external-file'
identifies the image file that you want to apply to the axis area of the plot. fileref must be a valid SAS fileref up to eight characters long and must have been previously assigned with a FILENAME statement. external-file must specify the complete filename of the image file that you want to use. The format of external-file varies across operating environments.
Restrictions:Not supported by Java

This option is overridden by the NOIMAGEPRINT goption. For information about the NOIMAGEPRINT goption, see IMAGEPRINT.

See: the IMAGESTYLE= option and Displaying an Image in Graph Frame .
IMAGESTYLE= TILE | FIT
specifies whether to use multiple instances of the image to fill the axis area (TILE) or to stretch a single instance of the image to fill the (FIT). The TILE value is the default.
Restriction:Not supported by Java
LAUTOHREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the horizontal axis, as specified by the AUTOHREF option. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. The default line type is retrieved from the current style, or if the NOGSTYLE option is specified, the default value is 1, which draws a solid line.
LAUTOVREF=reference-line-type
specifies a line type for reference lines drawn at major tick marks on the vertical axis, as specified by the AUTOVREF option. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. The default line type is retrieved from the current style, or if the NOGSTYLE option is specified, the default value is 1, which draws a solid line.
Style reference:LineStyle attribute of the GraphGridLines element
LEGEND | LEGEND=LEGEND<1...99>
generates a legend or specifies the legend to use for the plot.
  • a PLOT statement that includes the OVERLAY option does not automatically generate a legend. In these plot types, use LEGEND to produce a default legend, or LEGEND=LEGENDn to assign a defined LEGEND statement to the plot. The default legend is centered below the axis frame and identifies which colors and plot symbols represent the y-variables that you specify for the plots. To control the order of the legend entries for overlaid plots, use the ORDER= option in the LEGEND statement and specify the list of variables in quotation marks in the preferred order. For example, the following causes the legend entry for y3 to be displayed first, y1 next, and y2 last:
    legend1 order=('y3' 'y1' 'y2'); 
    proc gplot data=mydata2;   
    plot (y1 y2 y3)*x / overlay  legend=legend1; 
    run;
    For more information about the ORDER= option see ORDER=(value-list) | DESCENDING in the LEGEND statement.
  • a plot request of the form y-variable*x-variable=third-variable automatically generates a default legend that identifies which colors and plot symbols represent each value of the classification variable. In these plot types, override the default by using LEGEND=LEGENDn to assign a defined LEGEND statement to the plot.
If you use the SHAPE= option in a LEGEND statement, the value SYMBOL is valid. If you use the PLOT statement's AREAS= option, SHAPE=BAR is also valid.
LHREF=reference-line-type | (reference-line-type) | (reference-line-type-list)
specifies line types for reference lines drawn perpendicular to the horizontal axis. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. This option affects reference lines drawn with the AUTOHREF, HREF, and GRID options. Specifying a single line type without parentheses applies that line type to all reference lines. The LAUTOHREF= option overrides the LHREF= option for lines drawn with the AUTOHREF option. Specifying a single line type in parentheses applies that line type only to the first reference line drawn with the HREF= option. Specifying a line-type list applies line types in sequence to successive reference lines drawn with the HREF= option. The syntax of the line type list requires parentheses and line types separated by spaces (type1 type2... typeN). The default line type is retrieved from the current style, or if the NOGSTYLE option is specified, the default value is 1, which draws a solid line. To specify colors for these references lines, use the CHREF= option. To specify labels for these reference lines, use the HAXIS= option.
Alias:LH=
Style reference:LineStyle attribute of the GraphGridLines element
LVREF=reference-line-type | (reference-line-type) | (reference-line-type-list)
specifies the type of reference lines drawn with the AUTOVREF, VREF, and GRID options. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. This option affects reference lines drawn with the AUTOVREF, VREF, and GRID options. Specifying a single line type without parentheses applies that line type to all reference lines. The LAUTOVREF= option overrides the LVREF= option for lines drawn with the AUTOVREF option. Specifying a single line type in parentheses applies that line type only to the first line drawn with the VREF= option. Specifying a line-type list applies line types in sequence to successive reference lines drawn with the VREF= option. The syntax of the line type list requires parentheses and line types separated by spaces (type1 type2... typeN). The default line type is retrieved from the current style, or if the NOGSTYLE option is specified, the default value is 1, which draws a solid line. To specify colors for these references lines, use the CVREF= option. To specify labels for these reference lines, use the VAXIS= option.
For needle plots that are generated with a Java or ActiveX device driver, the value of the LVREF= option is not applied to the default reference line that is drawn at zero when the minimum value of the vertical axis is less than zero. This line is solid (not dashed).
Alias:LV=
Style reference:LineStyle attribute of the GraphGridLines element
Restriction:Partially supported by Java and ActiveX
NAME='entry-name'
specifies the name of the GRSEG catalog entry and the name of the graphics output file, if one is created. The name can be up to 256 characters long, but the GRSEG name is truncated to eight characters. Uppercase characters are converted to lowercase, and periods are converted to underscores. The default name is GPLOT. If the name duplicates an existing name, then SAS/GRAPH adds a number to the name to create a unique name. An example is GPLOT1.
If the name specified is exactly eight characters long, then the last character of the image output filename is replaced with a number. For example, myimages is changed to myimage1.
NOAXIS
suppresses the axes, including axis lines, axis labels, all major and minor tick marks, and tick mark values.
Alias:NOAXES
NOLASTAREA
removes the last area of a plot when the value specified by the AREAS= option exceeds the number of bounded areas in the plot. The last area is the area between the last plot line and the axis frame. You can use the NOLASTAREA option in PLOT and PLOT2 statements. However, when both PLOT and PLOT2 statements exist, the NOLASTAREA option is ignored in the PLOT statement. The NOLASTAREA option is also ignored in both PLOT and PLOT2 statements when the AREAS= option is not specified or when the number of bounded areas in the plot is less than or equal to the value specified by the AREAS= option.
Alias:NOLASTFILL
Restriction:Not supported by Java and ActiveX.
Note:Certain conditions related to the PLOT2 statement might result in variations in the behavior of the NOLASTAREA option.
NOLEGEND
suppresses the legend that is generated by a plot request of the type y-variable*x-variable=third-variable.
OVERLAY
places all the plots that are generated by the PLOT statement on one set of axes. The axes are scaled to include the minimum and maximum values of all of the variables, and the variable names or labels associated with the first pair of variables label the axes.
The OVERLAY option produces a legend if you include the LEGEND or the LEGEND=n option in the PLOT statement.
OVERLAY is not enabled with plot requests of the form y-variable*x-variable=third-variable. However, you can achieve an overlay effect by using a PLOT and PLOT2 statement.
When generating output for the Web with the JAVA, JAVAMETA, or JAVAIMG device drivers, the OVERLAY option cannot be used in the PLOTor PLOT2 statement under these conditions:
  • if the PLOT or PLOT2 statement is combined with the global SYMBOL statement when the SYMBOL statement uses the INTERPOL= BOX, HILO, or STD.
  • or for JAVA output using the PLOT2 statement, in a SYMBOL statement when the SYMBOL statement uses the INTERPOL= BOX, HILO, or STD, with or without the OVERLAY option.
Restriction:Partially supported by Java
REGEQN
displays the regression equation that is specified in the INTERPOL= option of the SYMBOL statement in the lower left corner of the plot. You cannot modify the format that is used for the equation.
The GPLOT regression equation is computed from the screen coordinates of the markers. Therefore, a graph might not be displayed if the chart area for the plot becomes so small that markers cannot be drawn because there are no coordinates from which to build the regression equation. In such cases, the regression equation is no longer meaningful.
Restriction:Not supported by ActiveX
SKIPMISS
breaks a plot line or an area fill at occurrences of missing values of the Y variable. By default, plot lines and area fills are not broken at missing values. The SKIPMISS option is available only with JOIN interpolation. If the SKIPMISS option is used, observations should be sorted by the independent (horizontal axis) variable. If the plot request is y-variable*x-variable=third-variable, observations should also be sorted by the values of the third variable.
URL=character-variable
specifies a character variable whose values are URLs. The variable values are URLs for Web pages to display when the user clicks (drills down) on elements in the graph.
Restrictions: This option affects graphics output that is created through the ODS HTML destination only

Not supported by the JAVAIMG and ACTXIMG devices

Interaction:If you specify both the HTML= and the URL= options, then the URL= option is ignored

Example: GIF Output with Drill-Down Links

VAXIS=value-list | AXIS<1...99>
specifies the major tick mark values for the vertical axis or assigns an axis definition. For a description of value-list see HAXIS=value-list | AXIS<1 . . . 99> for the PLOT statement. To assign labels to reference lines, use an axis definition that contains the REFLABEL= option. The labels are applied in sequence to all reference lines defined with the AUTOVREF and VREF= options.
For Web output that is generated with a Java or ActiveX device driver, certain options of the AXIS statement are not supported. For details, see the AXIS Statement.
Restriction:Partially supported by Java and ActiveX
VMINOR=number-of-minor-ticks
specifies the number of minor tick marks that are drawn between each major tick mark on the vertical axis. Minor tick marks are not labeled. The VMINOR= option overrides the NUMBER= suboption of the MINOR= option in an AXIS definition. You must specify a positive number.
VREF=value | (value) | (value-list)
draws one or more reference lines perpendicular to the vertical axis at specified points. For a description of value-list see HAXIS=value-list | AXIS<1 . . . 99> for the PLOT statement. If the AREAS= option is also used, the filled areas cover the reference lines. To draw lines on top of the filled areas, use the FRONTREF option. LVREF=, CVREF=, and WVREF= options can be used to change the line types, colors, and widths of these reference lines. To specify labels for these reference lines, use the VAXIS= option.
VREVERSE
specifies that the order of the values on the vertical axis be reversed.
VZERO
specifies that tick marks on the vertical axis begin in the first position with a zero. The VZERO request is ignored if the vertical variable either contains negative values or has been ordered with the VAXIS= option or the ORDER= option in an AXIS statement.
WAUTOHREF=reference-line-width
specifies the line width for all reference lines at major tick marks on the horizontal axis as determined by the AUTOHREF option. Line widths are specified as whole numbers with the default value being 1. To specify a color for these reference lines, use the option CAUTOHREF=reference-line-color.
Style reference:LineThickness attribute of the GraphGridLines element
WAUTOVREF=reference-line-widtht
specifies the line width for all reference lines at major tick marks on the vertical axis as determined by the AUTOVREF option. Line widths are specified as whole numbers with the default value being 1. To specify a color for these reference lines, use the option CAUTOVREF=reference-line-color.
Style reference:LineThickness attribute of the GraphGridLines element
WHREF=reference-line-width | (reference-line-width) | (reference-line-width-list)
specifies line widths for reference lines as determined by the horizontal axis. Line widths are specified as whole numbers. Specifying a line width without parentheses applies that type to all reference lines drawn with the AUTOHREF and HREF= options. Note that the WAUTOHREF= option overrides WHREF=reference-line-width for reference lines drawn with the AUTOREF option. Specifying a single line width in parentheses applies that line width to the first reference line drawn with theH REF= option. Specifying a line width list applies line widths in sequence to successive reference lines drawn with the HREF= option. The syntax of the line-width list requires parentheses and line widths separated by spaces (width1 width2 ...widthN). The default line width is specified by the current style or by the AXIS statement's WIDTH= option. (By default, WIDTH=1.) .To specify a color for these reference lines, use the option CHREF=reference-line-color | (reference-line-color) | (reference-line-color-list).
Style reference:LineThickness attribute of the GraphGridLines element
WVREF=reference-line-width | (reference-line-width) | (reference-line-width-list)
specifies line widths for reference lines as determined by the vertical axis. Line widths are specified as whole numbers. Specifying a line width without parentheses applies that type to all reference lines drawn with the AUTOVREF and VREF= options. Note that the WAUTOVREF= option overrides WVREF=reference-line-width for reference lines drawn with the AUTOREF option. Specifying a single line width in parentheses applies that line width to the first reference line drawn with the VREF= option. Specifying a line width list applies line widths in sequence to successive reference lines drawn with the VREF= option. The syntax of the line-width list requires parentheses and line widths separated by spaces (width1 width2 ...widthN). The default line width is specified by the current style or by the AXIS statement's WIDTH= option. (By default, WIDTH=1.) .To specify a color for these reference lines, use the option CVREF=reference-line-color | (reference-line-color) | (reference-line-color-list).
Style reference:LineThickness attribute of the GraphGridLines element

Details

Description

The PLOT statement specifies one or more plot requests that name the horizontal and left vertical axis variables, and can specify a third classification variable. This statement automatically does the following:
  • scales the axes to include the maximum and minimum data values
  • plots data points within the axes
  • labels each axis with the name of its variable and displays each major tick mark value.
You can use statement options to manipulate the axes, modify the appearance of your graph, and describe catalog entries. You can use SYMBOL definitions to modify plot symbols for the data points, join data points, draw regression lines, plot confidence limits, or specify other types of interpolations. For more information about the SYMBOL statement, see About SYMBOL Definitions.
In addition, you can use global statements to modify the axes; add titles, footnotes, and notes to the plot; or modify the legend if one is generated by the plot. You can also use an Annotate data set to enhance the plot.

Plot Requests with Multiple Variables

Plot requests with multiple variables produce a separate plot for every Y*X pair, unless you specify OVERLAY. For example, this statement produces four plots (the actual plots are produced on separate pages). See Graphs Generated by Multiple Plot Requests.
plot (y b)*(x a);
Graphs Generated by Multiple Plot Requests
Graphs Generated by Multiple Plot Requests

About SYMBOL Definitions

SYMBOL statements control the appearance of plot symbols and lines, and define interpolation methods. They can specify the following:
  • the shape, size, and color of the plot symbols that mark the data points
  • plot line style, color, and width
  • an interpolation method for plotting data
  • how missing values are treated in interpolation calculations
SYMBOL definitions are assigned either by default by the GPLOT procedure or explicitly with a plot request.
If no SYMBOL definition is currently in effect, the GPLOT procedure produces a scatter plot of the data points using the default plot symbol. If you need more than one SYMBOL definition, the procedure rotates through the colors defined by the current style, or if the NOGSTYLE option is specified, through the device color list. If the current color list contains only one color, or if all the colors are used, additional plot symbols are used.
If SYMBOL definitions have been defined but not explicitly assigned by a plot request of the form y-variable*x-variable=n, the procedure assigns them in the order in which they are generated. For example, this statement creates three plots:
plot y*x b*a s*r;
The procedure assigns the first generated SYMBOL definition to Y*X, the second generated SYMBOL definition to B*A, and the third to S*R.
If more SYMBOL definitions are needed than have been defined, the procedure uses the default definitions for the plots that remain.

About Plot Requests That Assign a SYMBOL Definition

Plot requests of the form y-variable*x-variable=n are useful when you use the OVERLAY option to produce multiple plots on one graph and you want to assign a particular SYMBOL definition to each plot.
With plot requests of this type it is important to remember that a single SYMBOL statement can generate multiple SYMBOL definitions, so that the SYMBOL definition that is designated by n might not be the same as the SYMBOL statement of the same number. That is, the third SYMBOL definition is not necessarily the same as the SYMBOL3 statement. For more information see the SYMBOL Statement.