BookmarkSubscribeRSS Feed
Bugmeister
Calcite | Level 5

Hello all,

I am trying to graph a 3D ordination using proc g3d and have the data point labels display beside each data point. I have created an annotate dataset that controls the format of the labels. When I run the program, the data labels for each label seem a very long distance away from each data point. Also, the program will not display all of the labels, the log message says something like 'only first instance of each x and y label will be displayed'. Any advice?  Below is the relevant program:

 

goptions reset=all cback=white border htitle=12pt htext=10pt;
%let x_min=-1.59;
%let x_max=1.5;
%let x_ticks=3;
%let y_min=-1.59;
%let y_max=1.5;
%let y_ticks=3;
%let z_min=-1.59;
%let z_max=1.5;
%let z_ticks=3;

 

data sppname;
 set two;
 if Role='M';
 size=0.75;
 xsys='2'; ysys='2'; zsys='2';
 x=Ax3;
 y=Ax1;
 z=Ax2;
 Function='Label';
 Text=Abbrev;
 position='A';

Data twoa;
 set two end=last;
 output;
 if last;
  Ax3=&x_min;
  Ax1=&y_min;
  Ax2=&z_min;
  output;
  Ax3=&x_max;
  Ax1=&y_max;
  Ax2=&z_max;
  output;
  run;
 proc g3d;
  scatter Ax3*Ax1=Ax2 /
   anno=sppname
   grid
   xticknum=&x_ticks
   yticknum=&y_ticks
   zticknum=&z_ticks
   shape= symbol
   size=symsize
   color=symcolor
   noneedle
   rotate= -45;
   label Ax2 = 'NMS Axis 2'
         Ax1 = 'NMS Axis 1'
         Ax3 = 'NMS Axis 3';

 

Thanks,

Bugmeister

2 REPLIES 2
ballardw
Super User

I suspect the apparent distance between annotate label and data point has to do with conversion (or lack) of 2 dimesion to apparent 3-d location. Change the rotate value (noticeably say to + 30). If the labels stay in the same position and the graph moves you'll see what I'm talking about. Or use an angle list to move the chart in steps.

 

 

GraphGuy
Meteorite | Level 14

I've never tried annotate with proc g3d scatter, but here is an old example from the V6 Examples book that might help.

 

http://robslink.com/SAS/democd44/ex_07_info.htm

 

ex_07.png

 

 

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 2 replies
  • 812 views
  • 0 likes
  • 3 in conversation