BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
trekvana
Calcite | Level 5

hello all-

is there any procedure that can interactivaely rotate 3d plots. right now i am using proc g3d and using the rotate and tilt options but it would be nice to have an interactive graph that i can just rotate with my mouse.

any suggestions?

george

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Hey George,

Just use GOPTIONS DEVICE=ACTIVEX with your PROC G3D program, and you will get interactive output. You will also need to wrap your program with ODS HTML to generate html  output to contain the ACTIVEX control.

Hope this helps!

Dan

View solution in original post

5 REPLIES 5
art297
Opal | Level 21

I think that the following might provide the info you are looking for:

http://www.robslink.com/SAS/democd8/uscont_info.htm

DanH_sas
SAS Super FREQ

Hey George,

Just use GOPTIONS DEVICE=ACTIVEX with your PROC G3D program, and you will get interactive output. You will also need to wrap your program with ODS HTML to generate html  output to contain the ACTIVEX control.

Hope this helps!

Dan

trekvana
Calcite | Level 5

Thanks guys!

MikeZdeb
Rhodochrosite | Level 12

Hi ... you can also try some animation.  This plot has been around for a while and

I cut/pasted/modified some SAS code from Richard Devenezia's wonderful web site ...

http://www.devenezia.com/downloads/sas/samples/cowboy-hats.sas

data hat;

do x=-5 to 5 by .25;

do y=-5 to 5 by .25;

   z=sin(sqrt(x*x+y*y));

   output;

end;

end;

run;

%macro plots (n);

%local i;

%do i = 1 %to &n;

%let rotate = %sysevalf(90 * &i/&n);

%let tilt   = %sysevalf(90 * &i/&n);

%put ITERATION &i;

%if &i eq 2  %then goptions gsfmode=append;;

%if &i eq &n %then goptions gepilog='3B'x;;

title "ROTATE & TILT: &rotate DEGREES" ls=2;

proc g3d data=hat;

plot y*x=z/ctop=white cbottom=yellow noaxis rotate=&rotate tilt=&tilt;

run;

quit;

%end;

title;

%mend;

goptions reset=all device=gifanim gsfname=animout xpixels=1024 ypixels=768

         gsfmode=replace gunit=pct ftext='calibri/bo' ctext=yellow cback=grayaa

         htitle=4 htext=3 border

         iteration=1    /* specify one iteration for the animation */

         delay=10;      /* delay in 0.01 seconds) */

filename animout "z:\cowboy.gif";

filename tmp temp;

options nomprint nonotes;

ods listing file=tmp;

%plots(100);

ods listing;

options notes;

GraphGuy
Meteorite | Level 14

If you have a SAS/Insight license, you can also use that to create & rotate a 3d chart.

For example...

Run dms SAS on Windows.

Run 'insight' from the SAS command line.

Select/Open a data set - I'll use maps.africa for this quick example

Select/drag your mouse across the Density & X & Y variables in the table (just for the sake of an easy example)

Run the "Analyze -> Rotating Plot (Z Y X)" from the pulldown menu at the top edge of the dms sas session.

You now have a 3d scatter plot.

You can use the navigation buttons along the left to rotate the plot in 3d.

Move your mouse pointer to a corner of the graphics area, and it will turn to a hand.

Hold the mouse button down while it's a hand, and then you can use the hand to interactively spin the plot.

You can even give the plot a good push/spin, and let go of the mouse button, and the plot will continue to spin - I'm not sure how useful this is, but it's pretty cool to watch! Smiley Happy

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3808 views
  • 4 likes
  • 5 in conversation