Personal tools
You are here: Home Software Packages SAS Output and Graphics using SAS Quick 3D Graph in PC SAS

Quick 3D Graph in PC SAS

— filed under: ,

An example of creating a 3D vertical bar chart that is suitable for publication

Here are the steps used to create this graph:

graph final


from a sas data set that looks like this:

Var1 Var2
Var3
1 2 1063315.2642
2 1 34614651.345
3 1 2650246.4126
4 3 26121344.23
5 4 1235123.12
etc...




Set your output preferences from the menu bar as follows:

  1. Tools-->Options-->Preferences
  2. Select the "Results" tab and make the following selections to direct output to HTML.
graph preferences


Run a PROC G3D

* Note: activex device only works with PC/Sas;

goptions device=activex;

* Express the plot as y*x=z;

proc g3d data=sasuser.mydata;
scatter var2 * var1 = var3 /grid ;
format var3 8.0;
run;
quit;
Look at the bottom of youir screen and open the "Results Viewer". You will see something like this:
graph default output


Tinker with the display in the Results Viewer

Now comes the fun part. You can change the display in any number of ways interactively.
  1. Put the cursor on the graph and right-mouse to pull up a list of options Select Chart Type--> Vertical Bar
  2. To make the Z axis run from 5 to 1, right-mouse over the graph again and select Graph Preferences, select Axis tab, select Depth from the drop-down and check Reverse. You can play with colors, title, and other attributes with other tabs in the Graph Preferences window as well.
  3. Double-click on the var1, var2 or var3 axis labels to create more descriptive labels for each axis.
  4. Right-mouse and select Titles-->Title or Footnote to complete the graph
  5. Right-mouse and select Save as... to save the final graph as a jpg or Copy it into a Word document or send directly to a printer.

Document Actions

Copyright ©2009, The Pennsylvania State University | Privacy and Legal Statements
Contact the Help Site Administrator | Last modified Aug 13, 2008 | Weblion Partner