Sample 24859: Reverse the Y axis values
/* Multiply values by -1 to reverse the axis */
/* order and use a format to reverse the */
/* values. */
/* Set graphics options */
goptions reset=all colors=(blue) ctext=black border;
/* Create format */
proc format;
picture rev
low - < 0 = '00009.00'
0 < - high = '00009.00' (prefix='-');
run;
/* Create input data set, ONE */
data one;
input Y X Z;
datalines;
-1.15 5 .03
-1.00 3 .02
2.20 3 .03
2.25 4 .04
2.50 5 .05
1.10 1 .06
1.15 2 .07
1.20 3 .08
1.25 4 .09
1.30 5 .10
;
/* Create data set, TWO, that multiplies the Y values by -1 */
data two;
set one;
Y=-1*Y;
run;
proc print;
format Y rev.;
run;
/* Create title */
title1 'Response vs Stimulus';
/* Create graph */
proc g3d data=two;
scatter Y * X = Z / shape='pillar' color='red' size=2 zmin=0;
format Y rev.;
run;
quit;

You can multiply the variable values by -1 in order to reverse the axis order. Use PROC FORMAT to create a format so that the correct values are displayed on the graph. A FORMAT statement is also needed in order to associate the format with the variable.
| 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 |