Procedure features: |
Scatter
statement |
COLOR= |
SHAPE= |
DATA Step |
NOTE statement |
|
Sample library
member: |
GTDSHAPA
|
![[Scatter Plot with Shapes and Colors]](images/gtdshapa.gif)
This
scatter plot modifies the results of measuring the petal length,
petal width, and sepal length for the flowers of three species of irises by:
-
using a DATA step to add a color variable and a shape variable
to the data set
-
using shapes to distinguish iris species
-
using colors to distinguish iris species
-
using a Note statement to
simulate a legend
 |
goptions reset=all border; |
 |
title1 "Iris Species Classification";
title2 "Physical Measurement";
title3 "Source: Fisher (1936) Iris Data";
footnote1 j=l "Sepal Width not Shown"; |
 |
data=iris;
set sashelp.iris;
length color shape $8.;
if species="Setosa" then do; shape="club"; color="blue"; end
if species="Versicolor" then do; shape="diamond"; color="red"; end;
if species="Virginica" then do; shape="spade"; color="green"; end'
run; |
 |
proc g3d data=iris;
note j=r f="Albany AMT/bo" "Species: : c=green "Virginica "
j=r c=red "Versicolor "
j=r c=blue "Setosa ";
scatter PetalLength*PetalWidth=SepalLength/
color=color
shape=shape;
run;
quit; |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.