PLOT Procedure

PROC PLOT Statement

Requests the plots be produced.
Tip: You can use data set options with the DATA= option. See Data Set Options for a list.
Excluding Observations That Have Missing Values

Syntax

PROC PLOT <option(s)>;

Summary of Optional Arguments

specifies the input data set.
Control the appearance of the plot
specifies the characters that construct the borders of the plot.
suppresses the legend at the top of the plot.
specifies the aspect ratio of the characters on the output device.
Control the axes
includes missing character variable values.
excludes observations with missing values.
uniformly scales axes across BY groups.
Control the size of the plot
specifies the percentage of the available horizontal space for each plot.
specifies the percentage of the available vertical space for each plot.

Optional Arguments

DATA=SAS-data-set
specifies the input SAS data set.
FORMCHAR <(position(s))>='formatting-character(s)'
defines the characters to use for constructing the borders of the plot.
position(s)
identifies the position of one or more characters in the SAS formatting-character string. A space or a comma separates the positions.
Default:Omitting (position(s)) is the same as specifying all twenty possible SAS formatting characters, in order.
Range:PROC PLOT uses formatting characters 1, 2, 3, 5, 7, 9, and 11. The following table shows the formatting characters that PROC PLOT uses.
Character Positions
Position
Default
Used to Draw
1
|
Vertical separators
2
-
Horizontal separators
3 5 9 1 1
-
Corners
7
+
Intersection of vertical and horizontal separators
formatting-character(s)
lists the characters to use for the specified positions. PROC PLOT assigns characters in formatting-character(s) to position(s), in the order in which they are listed. For example, the following option assigns the asterisk (*) to the third formatting character, the pound sign (#) to the seventh character, and does not alter the remaining characters: formchar(3,7)='*#'
Interaction:The SAS system option FORMCHAR= specifies the default formatting characters. The system option defines the entire string of formatting characters. The FORMCHAR= option in a procedure can redefine selected characters.
Tips:You can use any character in formatting-characters, including hexadecimal characters. If you use hexadecimal characters, then you must put x after the closing quotation mark. For example, the following option assigns the hexadecimal character 2D to the third formatting character, the hexadecimal character 7C to the seventh character, and does not alter the remaining characters: formchar(3,7)='2D7C'x

Specifying all blanks for formatting-character(s) produces plots with no borders, for example: formchar (1,2,7)=''

HPERCENT=percent(s)
specifies one or more percentages of the available horizontal space to use for each plot. HPERCENT= enables you to put multiple plots on one page. PROC PLOT tries to fit as many plots as possible on a page. After using each of the percent(s), PROC PLOT cycles back to the beginning of the list. A zero in the list forces PROC PLOT to go to a new page even if it could fit the next plot on the same page.
HPERCENT=33
prints three plots per page horizontally; each plot is one-third of a page wide.
HPERCENT=50 25 25
prints three plots per page; the first is twice as wide as the other two.
HPERCENT=33 0
produces plots that are one-third of a page wide,; each plot is on a separate page.
HPERCENT=300
produces plots three pages wide.
At the beginning of every BY group and after each RUN statement, PROC PLOT returns to the beginning of the percent(s) and starts printing a new page.
Alias:HPCT=
Default:100
MISSING
includes missing character variable values in the construction of the axes. It has no effect on numeric variables.
Interaction:overrides the NOMISS option for character variables.
NOLEGEND
suppresses the legend at the top of each plot. The legend lists the names of the variables being plotted and the plotting symbols used in the plot.
NOMISS
excludes observations for which either variable is missing from the calculation of the axes. Normally, PROC PLOT draws an axis based on all the values of the variable being plotted, including points for which the other variable is missing.
Interactions:The HAXIS= option overrides the effect of NOMISS on the horizontal axis. The VAXIS= option overrides the effect on the vertical axis.

NOMISS is overridden by MISSING for character variables.

UNIFORM
uniformly scales axes across BY groups. Uniform scaling enables you to directly compare the plots for different values of the BY variables.
Restriction:You cannot use PROC PLOT with the UNIFORM option with an engine that supports concurrent access if another user is updating the data set at the same time.
VPERCENT=percent(s)
specifies one or more percentages of the available vertical space to use for each plot. If you use a percentage greater than 100, then PROC PLOT prints sections of the plot on successive pages.
Alias:VPCT=
Default:100
See:HPERCENT=
VTOH=aspect-ratio
specifies the aspect ratio (vertical to horizontal) of the characters on the output device. aspect-ratio is a positive real number. If you use the VTOH= option, then PROC PLOT spaces tick marks so that the distance between horizontal tick marks is nearly equal to the distance between vertical tick marks. For example, if characters are twice as high as they are wide, then specify VTOH=2.
Interaction:VTOH= has no effect if you use the HSPACE= and the VSPACE= options in the PLOT statement.
Note:The minimum value allowed is 0.
See:HAXIS=axis-specification for a way to equate axes so that the given distance represents the same data range on both axes.