Chapter Contents

Previous

Next
The G3D Procedure

Example 6: Rotating a Scatter Plot


Procedure features:
SCATTER statement options
CAXIS=
ROTATE=
SIZE=
XTICKNUM
YTICKNUM=
ZMAX=
ZMIN=
ZTICKNUM=
Other features: DATA step
Sample library member: GR29N06

[IMAGE]

This example produces a scatter plot of humidity data. It uses color to distinguish air temperature ranges. The plot is rotated -15°.
 Note about code
libname reflib 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         colors=(black blue green red)
         ftext=swiss ftitle=swissb htitle=6 htext=4;
 Note about code
data reflib.humid;
   length colorval $ 8.;
   label wtemp='Wet-Bulb Temp';
   label relhum='Rel. Humidity';
   label atemp='   Air Temp.';
   input atemp wtemp relhum;
   if atemp<26 then colorval="blue";
   else if atemp>=26 and atemp<+52 then colorval="red";
   else if atemp>=52 and atemp<+78 then colorval="green";
   else if atemp>=78 and atemp<+104 then colorval="lib";
   else if atemp>104 then colorval="pink  ";
   datalines;
0    1     67
0    2     33
...more data lines...
130  34     29
130  35     28
;
 Note about code
title 'Relative Humidity in Percent';
footnote1 j=l '  Source: William L. Donn, Meteorology, Fourth Edition';
footnote2 j=r 'GR29N06 ';
 Note about code
proc g3d data=reflib.humid;
   scatter atemp*wtemp=relhum
         / shape='pillar'
           color=colorval
           caxis=blue
           rotate=-15
           size=.5
           yticknum=5
           xticknum=2
           zticknum=4
           zmin=0
           zmax=100;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.