Sample 25598: Rotating a surface plot using PROC G3D
This sample is from the "SAS/GRAPH Software: Reference, Version 8", Volume 2, Chapter 29.
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: GTDROTAT |
| TITLE: GTDROTAT-Rotating a Surface Plot |
| PRODUCT: GRAPH |
| SYSTEM: ALL |
| KEYS: GRAPHICS GOPTIONS G3D |
| PROCS: G3D |
| 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=3;
/* Create the data set WORK.HAT */
data hat;
do x=-5 to 5 by 0.25;
do y=-5 to 5 by 0.25;
z=sin(sqrt(x*x+y*y));
output;
end;
end;
run;
/* Define title and footnote for plot */
title 'Surface Plot of HAT Data Set';
footnote j=r 'GTDROTAT';
/* show the plot */
proc g3d data=hat;
plot y*x=z / grid
rotate=45
ctop=red
cbottom=black
yticknum=5
zticknum=5
zmin=-3
zmax=1;
run;
quit;

This example rotates the surface plot and enhances its axes by adding reference lines and increasing the number of tick marks on the y and z axes. It also raises the plot above the horizontal x-y plane.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> G3D Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Surface
|
| Date Modified: | 2005-09-22 03:03:14 |
| Date Created: | 2005-05-23 14:18:03 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |