PLOT Procedure

Example 1: Specifying a Plotting Symbol

Features:

PLOT statement : plotting symbol in plot request

Data set: DJIA
This example expands on a Simple Plot by specifying a different plotting symbol.

Program

options formchar="|----|+|---+=|-/\<>*";
data djia;
      input Year HighDate date7. High LowDate date7. Low;
      format highdate lowdate date7.;
      datalines;
1968 03DEC68   985.21 21MAR68   825.13
1969 14MAY69   968.85 17DEC69   769.93
...more data lines...
2006 27DEC06 12510.57 20JAN06 10667.39
2007 09OCT07 14164.53 05MAR07 12050.41
2008 02MAY08 13058.20 10OCT08  8451.19
;
proc plot data=djia;
      plot high*year='*'
      / vspace=5 vaxis=by 1000;
   title 'High Values of the Dow Jones Industrial Average';
   title2 'from 1968 to 2008';
run;

Program Description

Set the FORMCHAR option.Setting FORMCHAR to this exact string renders better HTML output when it is viewed outside of the SAS environment where SAS Monospace fonts are not available.
options formchar="|----|+|---+=|-/\<>*";
Create the DJIA data set. DJIA contains the high and low closing marks for the Dow Jones Industrial Average from 1968 to 2008 . The DATA step creates this data set.
data djia;
      input Year HighDate date7. High LowDate date7. Low;
      format highdate lowdate date7.;
      datalines;
1968 03DEC68   985.21 21MAR68   825.13
1969 14MAY69   968.85 17DEC69   769.93
...more data lines...
2006 27DEC06 12510.57 20JAN06 10667.39
2007 09OCT07 14164.53 05MAR07 12050.41
2008 02MAY08 13058.20 10OCT08  8451.19
;
Create the plot. The plot request plots the values of High on the vertical axis and the values of Year on the horizontal axis. It also specifies an asterisk as the plotting symbol.
proc plot data=djia;
      plot high*year='*'
      / vspace=5 vaxis=by 1000;
Specify the titles.
   title 'High Values of the Dow Jones Industrial Average';
   title2 'from 1968 to 2008';
run;

Output

PROC PLOT determines the tick marks and the scale of both axes.
Plot with Asterisk as the Plotting Symbol
High Values of the Dow Jones Industrial Average