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
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.
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
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.