Sample 25607: Using 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: GTGSPLIN |
| TITLE: GTGSPLIN-Using Spline Interpolation |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GOPTIONS G3GRID AXIS |
| PROCS: G3GRID GCONTOUR |
| DATA: INTERNAL |
| |
| SUPPORT: GRAPHICS STAFF UPDATE: |
| REF: SAS/GRAPH REFERENCE GUIDE |
+-------------------------------------------------------------+*/
/* Set the graphics environment */
goptions reset=all gunit=pct border cback=white
colors=(black blue green red)
ftext=swiss ftitle=swissb htitle=6 htext=4;
/* 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;
/* Define title and footnote for graph */
title 'Contour Plot after Default Interpolation';
footnote h=3 j=r 'GTGSPLIN(a)';
/* Define axis characteristics */
axis1 width=3;
/* Process points with PROC G3GRID */
proc g3grid data=nums out=numdef;
grid y*x=z / axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
/* Show the contour after default interpolation */
proc gcontour data=numdef;
plot y*x=z / haxis=axis1 vaxis=axis1;
run;
/* Define new title and footnote for graph */
title 'Contour Plot after Spline Interpolation';
footnote h=3 j=r 'GTGSPLIN(b)';
/* Process points with PROC G3GRID */
proc g3grid data=nums out=numspl;
grid y*x=z / spline
axis1=-5 to 5 by .5
axis2=-5 to 5 by .5;
run;
/* Show the contour after spline interpolation */
proc gcontour data=numspl;
plot y*x=z / haxis=axis1 vaxis=axis1;
run;
quit;

This example demonstrates the default and spline interpolation methods when used by the GCONTOUR procedure to generate contour plots from the resulting output data sets.
| Type: | Sample |
| Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Symbols/Interpolation SAS Reference ==> Procedures ==> G3GRID SAS Reference ==> Procedures ==> GCONTOUR
|
| Date Modified: | 2005-09-22 03:03:15 |
| Date Created: | 2005-05-23 14:18:38 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |