*hand28.txt; data ca88air; infile 'a:\CA88AIR.TXT'; input O3 CO NO3 SO4 TEMP HUMID DATE STATION $ MONTH; format date date7.; cards; PROC PRINT; RUN; options nodate nonumber ; GOPTIONS BORDER reset; ****************************************************************************************; title1; title2; title3; footnote; goptions htext=2; proc gplot data=ca88air; plot o3 * month; title1 '1988 Air Quality Data - Ozone'; title2 angle=90 'OZONE levels at three locations'; title3 angle=90 ' '; footnote1 angle=-90 rotate=90 'Figure 3.2.4a'; run; ****************************************************************************************; title1; title2; title3; footnote; * define the vertical axis ; axis1 label = (f=duplex h=1 a=90 'Ozone Level') order = (0 to 3 by 1) minor = (n=1) value = (t=3 h=1 'Alert'); * define the horizontal axis ; axis2 label = (f=duplex h=1 'Monthly Average') minor = none value = (h=1.5 f=simplex t=1 'Jan' t=2 'Feb' t=3 'Mar' t=4 f=swissb 'Apr' t=5 f=swissb 'May' t=6 'Jun' t=7 'Jul' t=8 'Aug' t=9 'Sep' t=10 'Oct' t=11 'Nov' t=12 'Dec'); proc gplot data=ca88air; where station='SFO'; plot o3 * month / vaxis=axis1 haxis=axis2 vref=2; title1 '1988 Air Quality'; title2 h=1.5 f=simplex 'Assigning tick mark text'; footnote1 h=1.5 j=l f=simplex 'Figure 3.3.2'; run; ****************************************************************************************; title1; title2; title3; footnote; goptions htext=2; proc gplot data=ca88air; plot co*month=station; symbol1 v='A' l=1 i=join c=black; symbol2 v='L' l=2 i=join c=black; symbol3 v='S' l=14 i=join c=black; title1 '1988 Carbon Monoxide Readings'; footnote1 j=l h=1.5 f=simplex 'Figure 4.3.3a'; run; ****************************************************************************************; title1; title2; title3; footnote; goptions htext=2; data air1 (keep=yvar month pltvar); set ca88air(keep=month co station); by station; retain pltvar offset; * hold the current value of month; tmon = month; * Create dummy axes for each station; * Allow three vertical units for each axis with one unit between * each plot.; if _n_=1 then do; pltvar=1; * axis for SFO; yvar=0; month=12; output; month=0; output; yvar=3; output; yvar=.; output; * axis for LIV; yvar=4; month=12; output; month=0; output; yvar=7; output; yvar=.; output; * axis for AZU; yvar=8; month=12; output; month=0; output; yvar=11; output; yvar=.; output; month=tmon; end; if first.station then do; * The data for each station is offset vertically to fit * with the dummy axes.; if station = 'AZU' then do; offset=8; pltvar=2; end; else if station = 'LIV' then do; offset=4; pltvar=3; end; else do; offset = 0; pltvar=4; end; end; yvar = co + offset; output; run; * Control the vertical axis; axis1 order = 0 to 11 by 1 label = (h=1.5 f=simplex 'ppm') minor=none style=0; * Control the horizontal axis; axis2 minor=none style=0; * Define the symbols for each subplot; * SYMBOL1 controls the axes; symbol1 v=none c=black l=1 i=join; symbol2 v='A' c=black l=1 i=join f=simplex; symbol3 v='L' c=black l=1 i=join f=simplex; symbol4 v='S' c=black l=1 i=join f=simplex; * Define a format for the vertical axis; proc format; value vert 0,4,8 = '0' 3,7,11 = '3' other = ' '; run; * Plot the data; proc gplot data=air1; plot yvar*month=pltvar / nolegend skipmiss vaxis=axis1 haxis=axis2; format yvar vert.; title1 '1988 Carbon Monoxide Readings'; footnote1 j=l h=1.5 f=simplex 'Figure 4.3.3b'; run; quit;