Chapter Contents

Previous

Next
The G3D Procedure

Example 4: Generating a Simple Scatter Plot


Procedure features:
SCATTER statement
Sample library member: GR29N04

[IMAGE]

This example shows a scatter plot that examines the results of measuring the petal length, petal width, and sepal length for the flowers of three species of iris. The SCATTER statement in this example relies entirely on procedure defaults, which scale the axes to include all data values, label the axes with the names of the axes variables, divide the axes into three even intervals, rotate the horizontal plane 70° around the z axis and tilt it 70° toward you, and display the plot with the colors that are defined for the colors list. The data points are represented by pyramids, which are connected to the horizontal plane with needles.
 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.iris;
   input sepallen sepalwid petallen petalwid spec_no;
   datalines;
50 33 14 02 1
64 28 56 22 3
...more data lines...
63 33 60 25 3
53 37 15 02 1
;
 Note about code
title1 'Iris Species Classification';
title2 'Physical Measurement';
title3 'Source: Fisher (1936) Iris Data';
footnote1 j=l '  Petallen: Petal Length in mm.'
          j=r 'Sepallen: Sepal Length in mm.   ';
footnote2 j=l '  Petalwid: Petal Width in mm.'
          j=r 'Sepal Width not shown          ';
footnote3 j=r 'GR29N04 ';
 Note about code
proc g3d data=reflib.iris;
   scatter petallen*petalwid=sepallen;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

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