Chapter Contents

Previous

Next
The G3GRID Procedure

Example 2: Using Spline Interpolation and a Smoothed Spline


Procedure features:
GRID statement options:
SMOOTH=
SPLINE
Data set: REFLIB.NUMS
Sample library member: GR30N02

[IMAGE]

This example extends Example 1 to specify a spline interpolation method on the GRID statement. The output data set, when used in PROC G3D, generates a smoother surface plot than the surface plot that results from the default interpolation shown in Example 1.

This example then specifies a smoothed spline interpolation method on the GRID statement. As shown by the following output, the resulting surface plot is smoother still.

[IMAGE]

 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=5 htext=3;
 Note about code
title 'Surface Plot After Spline Interpolation';
footnote j=r 'GR30N02(a) ';
 Note about code
proc g3grid data=reflib.nums out=spline;
   grid y*x=z / spline
                axis1=-5 to 5 by .5
                axis2=-5 to 5 by .5;
run;
 Note about code
proc g3d data=spline;
   plot y*x=z ;
run;
 Note about code
title 'Surface Plot After Smoothed Spline Interpolation';
footnote j=r 'GR30N02(b) ';
 Note about code
proc g3grid data=reflib.nums out=smoothed;
   grid y*x=z / spline
                smooth=.05
                axis1=-5 to 5 by .5
                axis2=-5 to 5 by .5;
run;
 Note about code
proc g3d data=smoothed;
   plot y*x=z;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

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