Sample 24858: Create an intersecting plane where Z=0 with PROC G3D
This sample uses PROC G3D with Annotate to produce a grid plane that intersects the Z axis at zero.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample uses PROC G3D with Annotate to produce a grid plane that intersects the Z axis at zero.
The graphics output in the Results tab was produced using SASĀ® 9.2. Submitting
the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create a sample data set */
data old;
do i=-10 to 10 by 1;
zvar=i;
xvar=ranuni(0);
yvar=ranuni(1);
output;
end;
run;
data anno;
/*Produce the plane*/
function='move'; xsys='1';ysys='1';zsys='2';line=1;size=1;
x=0; y=100; z=0;output;
function='draw';
x=100; y=100; z=0;output;
function='draw';
x=100; y=0; z=0;output;
function='draw';
x=0; y=0; z=0;output;
function='draw';
x=0; y=100; z=0;output;
/*Produce the grid lines*/
function='move'; xsys='1';ysys='1';zsys='2';line=2;size=1;
x=0; y=66; z=0;output;
function='draw';
x=100; y=66; z=0;output;
function='move';
x=0; y=33; z=0;output;
function='draw';
x=100; y=33; z=0;output;
function='move';
x=33; y=100; z=0;output;
function='draw';
x=33; y=0; z=0;output;
function='move';
x=66; y=100; z=0;output;
function='draw';
x=66; y=0; z=0;output;
run;
/* Add a title to the graph */
title1 'Adding an intersecting plane to G3D output';
/* Create the graph using the ANNO= option */
/* on the SCATTER statement */
proc g3d data=old;
scatter yvar*xvar=zvar / annotate=anno shape='pillar'
size=2 color='CX7C95CA';
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample uses PROC G3D with the Annotate facility to produce a grid plane that intersects the Z axis at zero.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> G3D
|
Date Modified: | 2005-08-24 16:06:23 |
Date Created: | 2004-11-11 11:07:51 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | n/a |