Syntax: PLOT Procedure


  • Requirement: At least one PLOT statement is required.

  • Tip: Supports RUN- group processing

  • Tip: Supports the Output Delivery System. See Output Delivery System on page 32 for details.

  • ODS Table Names : See: ODS Table Names on page 645

  • Reminder: You can use the ATTRIB, FORMAT, LABEL, and WHERE statements. See Chapter 3, Statements with the Same Function in Multiple Procedures, on page 57 for details. You can also use any global statements. See Global Statements on page 18 for a list.

PROC PLOT < option(s) >;

  • BY <DESCENDING> variable-1

    • < <DESCENDING> variable-n >

    • <NOTSORTED>;

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

To do this

Use this statement

Produce a separate plot for each BY group

BY

Describe the plots you want

PLOT

PROC PLOT Statement

Reminder: You can use data set options with the DATA= option. See Data Set Options on page 18 for a list.

PROC PLOT < option(s) >;

To do this

Use this option

Specify the input data set

DATA=

Control the axes

 

Include missing character variable values

MISSING

 

Exclude observations with missing values

NOMISS

 

Uniformly scale axes across BY groups

UNIFORM

Control the appearance of the plot

 

Specify the characters that construct the borders of the plot

FORMCHAR=

 

Suppress the legend at the top of the plot

NOLEGEND

 

Specify the aspect ratio of the characters on the output device

VTOH=

Control the size of the plot

 

Specify the percentage of the available horizontal space for each plot

HPERCENT=

 

Specify the percentage of the available vertical space for each plot

VPERCENT=

Options

DATA= SAS-data-set

  • specifies the input SAS data set.

    Main discussion: See Chapter 2, "Fundamental Concepts for Using Base SAS Procedures."

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.

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 that they are listed. For instance, 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.

    • Tip: You can use any character in formatting-characters , including hexadecimal characters. If you use hexadecimal characters, then you must put an x after the closing quotation mark. For instance, 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 
    • Tip: 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

  • Featured in: Example 4 on page 652

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.

  • Interaction: The HAXIS= option overrides the effect of NOMISS on the horizontal axis. The VAXIS= option overrides the effect on the vertical axis.

  • Interaction: NOMISS is overridden by MISSING for character variables.

  • Featured in: Example 10 on page 668

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

  • Featured in: Example 4 on page 652

  • See also: HPERCENT= on page 626

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.

  • Minimum:

    Interaction: VTOH= has no effect if you use the HSPACE= and the VSPACE= options in the PLOT statement.

    See also: HAXIS= on page 632 for a way to equate axes so that the given distance represents the same data range on both axes.

BY Statement

Produces a separate plot and starts a new page for each BY group.

Main discussion: BY on page 58

Featured in: Example 8 on page 662

  • BY <DESCENDING> variable-1

    • < <DESCENDING> variable-n >

    • <NOTSORTED>;

Required Arguments

variable

  • specifies the variable that the procedure uses to form BY groups. You can specify more than one variable. If you do not use the NOTSORTED option in the BY statement, then the observations in the data set must either be sorted by all the variables that you specify or be indexed appropriately. Variables in a BY statement are called BY variables .

Options

DESCENDING

  • specifies that the observations are sorted in descending order by the variable that immediately follows the word DESCENDING in the BY statement.

NOTSORTED

  • specifies that observations are not necessarily sorted in alphabetic or numeric order. The data is grouped in another way, for example, chronological order.

    The requirement for ordering or indexing observations according to the values of BY variables is suspended for BY-group processing when you use the NOTSORTED option. In fact, the procedure does not use an index if you specify NOTSORTED. The procedure defines a BY group as a set of contiguous observations that have the same values for all BY variables. If observations with the same values for the BY variables are not contiguous, then the procedure treats each contiguous set as a separate BY group.

PLOT Statement

Requests the plots to be produced by PROC PLOT.

Tip: You can use multiple PLOT statements.

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

To do this

Use this option

Control the axes

 

Specify the tick-mark values

HAXIS= and VAXIS=

 

Expand the axis

HEXPAND and VEXPAND

 

Specify the number of print positions

HPOS=

   

and

   

VPOS=

 

Reverse the order of the values

HREVERSE and VREVERSE

 

Specify the number of print positions between tick marks

HSPACE= and VSPACE=

 

Assign a value of zero to the first tick mark

HZERO

   

and

   

VZERO

Specify reference lines

 

Draw a line perpendicular to the specified values on the axis

HREF=

   

and

   

VREF=

 

Specify a character to use to draw the reference line

HREFCHAR= and VREFCHAR=

Put a box around the plot

BOX

Overlay plots

OVERLAY

Produce a contour plot

 
 

Draw a contour plot

CONTOUR

 

Specify the plotting symbol for one contour level

Scontour-level =

 

Specify the plotting symbol for multiple contour levels

SLIST=

Label points on a plot

 

List the penalty and the placement state of the points

LIST=

 

Force the labels away from the origin

OUTWARD=

 

Change default penalties

PENALTIES=

 

Specify locations for the placement of the labels

PLACEMENT=

 

Specify a split character for the label

SPLIT=

 

List all placement states in effect

STATES

Required Arguments

plot-request(s)

  • specifies the variables (vertical and horizontal) to plot and the plotting symbol to use to mark the points on the plot.

    Each form of plot-request(s) supports a label variable. A label variable is preceded by a dollar sign ($) and specifies a variable whose values label the points on the plot. For example,

     plot y*x $  label-variable  plot y*x='*' $  label-variable  

    See Labeling Plot Points with Values of a Variable on page 641 for more information. In addition, see Example 9 on page 665 and all the examples that follow it.

    The plot-request(s) can be one or more of the following:

vertical*horizontal <$ label-variable >

  • specifies the variable to plot on the vertical axis and the variable to plot on the horizontal axis.

    • For example, the following statement requests a plot of Y by X:

       plot y*x; 

      Y appears on the vertical axis, X on the horizontal axis.

  • This form of the plot request uses the default method of choosing a plotting symbol to mark plot points. When a point on the plot represents the values of one observation in the data set, PROC PLOT puts the character A at that point. When a point represents the values of two observations, the character B appears. When a point represents values of three observations, the character C appears, and so on through the alphabet. The character Z is used for the occurrence of 26 or more observations at the same printing position.

vertical*horizontal= character <$ label-variable >

  • specifies the variables to plot on the vertical and horizontal axes and specifies a plotting symbol to mark each point on the plot. A single character is used to represent values from one or more observations.

    For example, the following statement requests a plot of Y by X, with each point on the plot represented by a plus sign (+):

     plot y*x='+'; 

vertical*horizontal=variable <$ label-variable >

  • specifies the variables to plot on the vertical and horizontal axes and specifies a variable whose values are to mark each point on the plot. The variable can be either numeric or character. The first (left-most) nonblank character in the formatted value of the variable is used as the plotting symbol (even if more than one value starts with the same letter). When more than one observation maps to the same plotting position, the value from the first observation marks the point. For example, in the following statement GENDER is a character variable with values of FEMALE and MALE ; the values F and M mark each observation on the plot.

     plot height*weight=gender; 

Specifying Variable Lists in Plot Requests

You can use SAS variable lists in plot requests. For example, the following are valid plot requests:

Plot request

What is plotted

(a - - d)

a*b a*c a*d b*c b*d c*d

(x1 - x4)

x1*x2

 

x1*x3 x1*x4 x2*x3

 

x2*x4 x3*x4

(_numeric_)

All combinations of numeric variables

y*(x1 - x4)

y*x1

 

y*x2 y*x4 y*x4

If both the vertical and horizontal specifications request more than one variable and if a variable appears in both lists, then it will not be plotted against itself. For example, the following statement does not plot B*B and C*C:

 plot (a b c)*(b c d); 

Specifying Combinations of Variables

The operator in request is either an asterisk (*) or a colon (:). An asterisk combines the variables in the lists to produce all possible combinations of x and y variables. For example, the following plot requests are equivalent:

 plot (y1-y2) * (x1-x2);  plot y1*x1 y1*x2 y2*x1 y2*x2; 

A colon combines the variables pairwise. Thus, the first variables of each list combine to request a plot, as do the second, third, and so on. For example, the following plot requests are equivalent:

 plot (y1-y2) : (x1-x2);  plot y1*x1 y2*x2; 

Options

BOX

  • draws a border around the entire plot, rather than just on the left side and bottom.

    Featured in: Example 3 on page 650

CONTOUR<= number-of-levels >

  • draws a contour plot using plotting symbols with varying degrees of shading where number-of-levels is the number of levels for dividing the range of variable . The plot request must be of the form vertical*horizontal=variable where variable is a numeric variable in the data set. The intensity of shading is determined by the values of this variable.

    When you use CONTOUR, PROC PLOT does not plot observations with missing values for variable .

    Overprinting, if it is enabled by the OVP system option, is used to produce the shading. Otherwise , single characters varying in darkness are used. The CONTOUR option is most effective when the plot is dense.

  • Default: 10

  • Range: 1-10

  • Featured in: Example 7 on page 658

HAXIS= axis-specification

  • specifies the tick-mark values for the horizontal axis.

    • For numeric values , axis-specification is either an explicit list of values, a BY increment, or a combination of both:

      • n < n >

      • BY increment

      • n TO n BY increment

    • The values must be in either ascending or descending order. Use a negative value for increment to specify descending order. The specified values are spaced evenly along the horizontal axis even if the values are not uniformly distributed. Numeric values can be specified in the following ways:

HAXIS= value

Comments

10 to 100 by 5

Values appear in increments of 5, starting at 10 and ending at 100.

by 5

Values are incremented by 5. PROC PLOT determines the minimum and maximum values for the tick marks.

10 100 1000 10000

Values are not uniformly distributed. This specification produces a logarithmic plot. If PROC PLOT cannot determine the function implied by the axis specification, it uses simple linear interpolation between the points. To determine whether PROC PLOT correctly interpolates a function, you can use the DATA step to generate data that determines the function and see whether it appears linear when plotted. See Example 5 on page 655 for an example.

1 2 10 to 100 by 5

A combination of the previous specifications.

  • For character variables , axis-specification is a list of unique values that are enclosed in quotation marks:

    • value-1 < value-n >

      For example,

       haxis='Paris' 'London' 'Tokyo' 
  • The character strings are case-sensitive. If a character variable has an associated format, then axis-specification must specify the formatted value. The values can appear in any order.

  • For axis variables that contain date-time values , axis-specification is either an explicit list of values or a starting and an ending value with an increment specified:

    • date-time-value i < date-time-value i >

    • date-time-value i TO < date-time-value i >

      • <BY increment >

  • date-time-value i

    • any SAS date, time, or datetime value described for the SAS functions INTCK and INTNX. The suffix i is one of the following:

      D

      date

      T

      time

      DT

      datetime

  • increment

    • one of the valid arguments for the INTCK or INTNX functions: For dates, increment can be one of the following:

      • DAY

      • WEEK

      • MONTH

      • QTR

      • YEAR

      • For datetimes, increment can be one of the following:

      • DTDAY

      • DTWEEK

      • DTMONTH

      • DTQTR

      • DTYEAR

      • For times, increment can be one of the following:

      • HOUR

      • MINUTE

      • SECOND

      • For example,

         haxis='01JAN95'd to '01JAN96'd     by month  haxis='01JAN95'd to '01JAN96'd     by qtr 
  • Note: You must use a FORMAT statement to print the tick-mark values in an understandable form.

  • Interaction: You can use the HAXIS= and VAXIS= options with the VTOH= option to equate axes. If your data is suitable, then use HAXIS=BY n and VAXIS=BY n with the same value for n and specify a value for the VTOH= option. The number of columns that separate the horizontal tick marks is nearly equal to the number of lines that separate the vertical tick marks times the value of the VTOH= option. In some cases, PROC PLOT cannot simultaneously use all three values and changes one or more of the values.

  • Featured in: Example 2 on page 648, Example 5 on page 655, and Example 6 on page 656

HEXPAND

  • expands the horizontal axis to minimize the margins at the sides of the plot and to maximize the distance between tick marks, if possible.

    HEXPAND causes PROC PLOT to ignore information about the spacing of the data. Plots produced with this option waste less space but may obscure the nature of the relationship between the variables.

HPOS= axis-length

  • specifies the number of print positions on the horizontal axis. The maximum value of axis-length that allows a plot to fit on one page is three positions less than the value of the LINESIZE= system option because there must be space for the procedure to print information next to the vertical axis. The exact maximum depends on the number of characters that are in the vertical variable s values. If axis-length is too large to fit on a line, then PROC PLOT ignores the option.

HREF= value-specification

  • draws lines on the plot perpendicular to the specified values on the horizontal axis. PROC PLOT includes the values you specify with the HREF= option on the horizontal axis unless you specify otherwise with the HAXIS= option.

    For the syntax for value-specification , see HAXIS= on page 632.

    Featured in: Example 8 on page 662

HREFCHAR= character

  • specifies the character to use to draw the horizontal reference line.

    Default: vertical bar ()

    See also: FORMCHAR= option on page 626 and HREF= on page 634

HREVERSE

  • reverses the order of the values on the horizontal axis.

HSPACE= n

  • specifies that a tick mark will occur on the horizontal axis at every n th print position, where n is the value of HSPACE=.

HZERO

  • assigns a value of zero to the first tick mark on the horizontal axis.

    Interaction: PROC PLOT ignores HZERO if the horizontal variable has negative values or if the HAXIS= option specifies a range that does not begin with zero.

LIST<= penalty-value >

  • lists the horizontal and vertical axis values, the penalty, and the placement state of all points plotted with a penalty greater than or equal to penalty-value . If no plotted points have a penalty greater than or equal to penalty-value , then no list is printed.

    Tip: LIST is equivalent to LIST=0.

    See also: Understanding Penalties on page 642

    Featured in: Example 11 on page 670

OUTWARD= character

  • tries to force the point labels outward, away from the origin of the plot, by protecting positions next to symbols that match character that are in the direction of the origin (0,0). The algorithm tries to avoid putting the labels in the protected positions, so they usually move outward.

    Tip: This option is useful only when you are labeling points with the values of a variable.

OVERLAY

  • overlays all plots that are specified in the PLOT statement on one set of axes. The variable names, or variable labels if they exist, from the first plot are used to label the axes. Unless you use the HAXIS= or the VAXIS= option, PROC PLOT automatically scales the axes in the way that best fits all the variables.

    When the SAS system option OVP is in effect and overprinting is allowed, the plots are superimposed; otherwise, when NOOVP is in effect, PROC PLOT uses the plotting symbol from the first plot to represent points that appear in more than one plot. In such a case, the output includes a message telling you how many observations are hidden.

    Featured in: Example 3 on page 650

PENALTIES<( index-list )>= penalty-list

  • changes the default penalties. The index-list provides the positions of the penalties in the list of penalties. The penalty-list contains the values that you are specifying for the penalties that are indicated in the index-list . The index-list and the penalty-list can contain one or more integers. In addition, both index-list and penalty-list accept the form:

      value  TO  value  

    See also: Understanding Penalties on page 642

    Featured in: Example 13 on page 676

PLACEMENT=( expression(s) )

  • controls the placement of labels by specifying possible locations of the labels relative to their coordinates. Each expression consists of a list of one or more suboptions (H=, L=, S=, or V=) that are joined by an asterisk (*) or a colon (:). PROC PLOT uses the asterisk and colon to expand each expression into combinations of values for the four possible suboptions. The asterisk creates every possible combination of values in the expression list. A colon creates only pairwise combinations. The colon takes precedence over the asterisk. With the colon, if one list is shorter than the other, then the values in the shorter list are reused as necessary.

  • Use the following suboptions to control the placement:

  • H= integer(s)

    • specifies the number of horizontal spaces (columns) to shift the label relative to the starting position. Both positive and negative integers are valid. Positive integers shift the label to the right; negative integers shift it to the left. For example, you can use the H= suboption in the following way:

       place=(h=0 1 -1 2 -2) 

      You can use the keywords BY ALT in this list. BY ALT produces a series of numbers whose signs alternate between positive and negative and whose absolute values change by one after each pair. For instance, the following PLACE= specifications are equivalent:

       place=(h=0 -1 to -3 by alt)  place=(h=0 -1 1 -2 2 -3 3) 

      If the series includes zero, then the zero appears twice. For example, the following PLACE= options are equivalent:

       place=(h= 0 to 2 by alt)  place=(h=0 0 1 -1 2 -2) 

      Default: H=0

      Range: ˆ’ 500 to 500

  • L= integer(s)

    • specifies the number of lines onto which the label may be split.

      Default: L=1

      Range: 1-200

  • S= start-position(s)

    • specifies where to start printing the label. The value for start-position can be one or more of the following:

    • CENTER

      • the procedure centers the label around the plotting symbol.

    • RIGHT

      • the label starts at the plotting symbol location and continues to the right.

    • LEFT

      • the label starts to the left of the plotting symbol and ends at the plotting symbol location.

    • Default: CENTER

  • V= integer(s)

    • specifies the number of vertical spaces (lines) to shift the label relative to the starting position. V= behaves the same as the H= suboption, described earlier.

  • A new expression begins when a suboption is not preceded by an operator. Parentheses around each expression are optional. They make it easier to recognize individual expressions in the list. However, the entire expression list must be in parentheses, as shown in the following example. Table 33.1 on page 637 shows how this expression is expanded and describes each placement state.

     place=((v=1)         (s=right left : h=2 -2)         (v=-1)         (h=0 1 to 2 by alt * v=1 -1)         (l=1 to 3 * v=1 to 2 by alt *          h=0 1 to 2 by alt)) 
  • Each combination of values is a placement state . The procedure uses the placement states in the order in which they appear in the placement states list, so specify your most preferred placements first. For each label, the procedure tries all states, then uses the first state that places the label with minimum penalty. When all labels are initially placed, the procedure cycles through the plot multiple times, systematically refining the placements. The refinement step tries to both minimize the penalties and to use placements nearer to the beginning of the states list. However, PROC PLOT uses a heuristic approach for placements, so the procedure does not always find the best set of placements.

  • Alias: PLACE=

  • Defaults: There are two defaults for the PLACE= option. If you are using a blank as the plotting symbol, then the default placement state is PLACE=(S=CENTER : V=0 : H=0 : L=1), which centers the label. If you are using anything other than a blank, then the default is PLACE=((S=RIGHT LEFT : H=2 ˆ’ 2) (V=1 ˆ’ 1 * H=0 1 -1 2 -2)). The default for labels placed with symbols includes multiple positions around the plotting symbol so the procedure has flexibility when placing labels on a crowded plot.

  • Tip: Use the STATES option to print a list of placement states.

  • See also: Labeling Plot Points with Values of a Variable on page 641

  • Featured in: Example 11 on page 670 and Example 12 on page 674

Table 33.1: Expanding an Expression List into Placement States

Expression

Placement state

Meaning

(V=1)

S=CENTER L=1 H=0 V=1

Center the label, relative to the point, on the line above the point. Use one line for the label.

(S=RIGHT LEFT : H=2 ˆ’ 2)

S=RIGHT L=1 H=2 V=0

Begin the label in the second column to the right of the point. Use one line for the label.

 

S=LEFT L=1 H= ˆ’ 2 V=0

End the label in the second column to the left of the point. Use one line for the label.

(V= ˆ’ 1)

S=CENTER L=1 H=0 V= ˆ’ 1

Center the label, relative to the point, on the line below the point. Use one line for the label.

(H=0 1 to 2 BY ALT * V=1 ˆ’ 1)

S=CENTER L=1 H=0 V=1

Center the label, relative to the point, on the line above the point.

 

S=CENTER L=1 H=0 V= ˆ’ 1

Center the label, relative to the point, on the line below the point.

 

S=CENTER L=1 H=1 V=1

From center, shift the label one column to the right on the line above the point.

 

S=CENTER L=1 H=1 V= ˆ’ 1

From center, shift the label one column to the right on the line below the point.

 

S=CENTER L=1 H= ˆ’ 1 V=1

From center, shift the label one column to the left on the line above the point.

 

S=CENTER L=1 H= ˆ’ 1 V= ˆ’ 1

From center, shift the label one column to the left on the line below the point.

 

S=CENTER L=1 H=2 V=1

S=CENTER L=1 H=2 V= ˆ’ 1

From center, shift the labels two columns to the right, first on the line above the point, then on the line below.

 

S=CENTER L=1 H= ˆ’ 2 V=1

From center, shift the labels two columns to the left, first on the line above the point, then on the line below.

 

S=CENTER L=1 H= ˆ’ 2 V= ˆ’ 1

(L=1 to 3 * V=1 to 2 BY ALT * H=0 1 to 2 BY ALT)

S=CENTER L=1 H=0 V=1

Center the label, relative to the point, on the line above the point. Use one line for the label.

 

S=CENTER L=1 H=1 V=1

S=CENTER L=1 H= ˆ’ 1 V=1

S=CENTER L=1 H=2 V=1

S=CENTER L=1 H= ˆ’ 2 V=1

From center, shift the label one or two columns to the right or left on the line above the point. Use one line for the label.

 

S=CENTER L=1 H=0 V= ˆ’ 1

Center the label, relative to the point, on the line below the point. Use one line for the label.

 

S=CENTER L=1 H=1 V= ˆ’ 1

S=CENTER L=1 H= ˆ’ 1 V= ˆ’ 1

S=CENTER L=1 H=2 V= ˆ’ 1

S=CENTER L=1 H= ˆ’ 2 V= ˆ’ 1

From center, shift the label one or two columns to the right and the left on the line below the point.

 

.

 
 

.

 
 

.

Use the same horizontal shifts on the line two lines above the point and on the line two lines below the point.

 

S=CENTER L=1 H= ˆ’ 2 V= ˆ’ 2

 
 

S=CENTER L=2 H=0 V=1

Repeat the whole process splitting the label over two lines. Then repeat it splitting the label over three lines.

 

.

 
 

.

 
 

.

 
 

S=CENTER L=3 H= ˆ’ 2 V= ˆ’ 2

 

Scontour-level = character-list

  • specifies the plotting symbol to use for a single contour level. When PROC PLOT produces contour plots, it automatically chooses the symbols to use for each level of intensity. You can use the S= option to override these symbols and specify your own. You can include up to three characters in character-list . If overprinting is not allowed, then PROC PLOT uses only the first character.

    For example, to specify three levels of shading for the Z variable, use the following statement:

     plot y*x=z /     contour=3 s1=;A; s2=;+; s3=;X0A;; 

    You can also specify the plotting symbols as hexadecimal constants:

     plot y*x=z /     contour=3 s1='7A'x s2='7F'x s3='A6'x; 

    This feature was designed especially for printers where the hexadecimal constants can represent grey-scale fill characters.

    Range: 1 to the highest contour level (determined by the CONTOUR option).

    See also: SLIST= and CONTOUR

SLIST= character-list-1 < character-list-n >

  • specifies plotting symbols for multiple contour levels. Each character-list specifies the plotting symbol for one contour level: the first character-list for the first level, the second character-list for the second level, and so on. For example:

     plot y*x=z /     contour=5 slist='.' ':' '!' '=' '+O'; 

    Default: If you omit a plotting symbol for each contour level, then PROC PLOT uses the default symbols:

     slist='.' ',' '-' '=' '+' 'O' 'X'        'W' '*' '#' 

    Restriction: If you use the SLIST= option, then it must be listed last in the PLOT statement.

    See also: S contour-level = and CONTOUR=

SPLIT= split-character

  • when labeling plot points, specifies where to split the label when the label spans two or more lines. The label is split onto the number of lines that is specified in the L= suboption to the PLACEMENT= option. If you specify a split character, then the procedure always splits the label on each occurrence of that character, even if it cannot find a suitable placement. If you specify L=2 or more but do not specify a split character, then the procedure tries to split the label on blanks or punctuation but will split words if necessary.

    PROC PLOT shifts split labels as a block, not as individual fragments (a fragment is the part of the split label that is contained on one line). For example, to force This is a label to split after the a , change it to This is a*label and specify SPLIT='*' .

    See also: Labeling Plot Points with Values of a Variable on page 641

STATES

  • lists all the placement states in effect. STATES prints the placement states in the order that you specify them in the PLACE= option.

VAXIS= axis-specification

  • specifies tick mark values for the vertical axis. VAXIS= follows the same rules as theHAXIS= option on page 632.

    Featured in: Example 7 on page 658 and Example 12 on page 674

VEXPAND

  • expands the vertical axis to minimize the margins above and below the plot and to maximize the space between vertical tick marks, if possible.

    See also: HEXPAND on page 634

VPOS= axis-length

  • specifies the number of print positions on the vertical axis. The maximum value for axis-length that allows a plot to fit on one page is 8 lines less than the value of the SAS system option PAGESIZE= because you must allow room for the procedure to print information under the horizontal axis. The exact maximum depends on the titles that are used, whether or not plots are overlaid, and whether or not CONTOUR is specified. If the value of axis-length specifies a plot that cannot fit on one page, then the plot spans multiple pages.

    See also: HPOS= on page 634

VREF= value-specification

  • draws lines on the plot perpendicular to the specified values on the vertical axis. PROC PLOT includes the values you specify with the VREF= option on the vertical axis unless you specify otherwise with the VAXIS= option. For the syntax for value-specification , see HAXIS= on page 632.

    Featured in: Example 2 on page 648

VREFCHAR= character

  • specifies the character to use to draw the vertical reference lines.

    Default: horizontal bar (-)

    See also: FORMCHAR= option on page 626, HREFCHAR= on page 634, and VREF= on page 640

VREVERSE

  • reverses the order of the values on the vertical axis.

VSPACE= n

  • specifies that a tick mark will occur on the vertical axis at every n th print position, where n is the value of VSPACE=.

VZERO

  • assigns a value of zero to the first tick mark on the vertical axis.

    Interaction: PROC PLOT ignores the VZERO option if the vertical variable has negative values or if the VAXIS= option specifies a range that does not begin with zero.




Base SAS 9.1.3 Procedures Guide (Vol. 1)
Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4
ISBN: 1590472047
EAN: 2147483647
Year: 2004
Pages: 260

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net