Sample 25605: Using partial spline interpolation with PROC G3GRID
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 2, Chapter 30.
For additional information on the sample refer to this book.
/*+-------------------------------------------------------------+
| S A S S A M P L E L I B R A R Y |
| |
| NAME: GTGPART |
| TITLE: GTGPART-Using Partial Spline Interpolation |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GOPTIONS G3D G3GRID AXIS |
| PROCS: G3D G3GRID |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(blue black green red)
ftext=swiss ftitle=swissb htitle=6 htext=3;
/* Create data set WORK.NUMS using */
/* a set of randomly sampled points */
data nums;
keep x y z;
do i=1 to 30;
x=10*ranuni(33)-5;
y=10*ranuni(35)-5;
z=sin(sqrt(x*x+y*y));
output;
end;
run;
/* Process points with PROC G3GRID */
proc g3grid data=nums out=partial;
grid y*x=z / partial
near=8
axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
/* Define title and footnote for graph */
title 'Surface Plot After Partial Interpolation';
footnote j=r 'GTGPART';
/* Show the surface */
proc g3d data=partial;
plot y*x=z;
run;
quit;

This example specifies a partial spline interpolation method on the GRID statement, using eight nearest neighbors for computing the estimates of the first and second derivatives. The output data set generates a smoother surface plot than the surface plot that results from the default interpolation.
| Type: | Sample |
| Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Symbols/Interpolation SAS Reference ==> Procedures ==> G3D SAS Reference ==> Procedures ==> G3GRID
|
| Date Modified: | 2005-09-22 03:03:15 |
| Date Created: | 2005-05-23 14:18:30 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |