Data visualization with SAS programming

Control distance of data labels from data points in an Annotate dataset

Reply
Occasional Contributor
Posts: 5

Control distance of data labels from data points in an Annotate dataset

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

Grand Advisor
Posts: 10,223

Re: Control distance of data labels from data points in an Annotate dataset

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.

 

 

SAS Employee
Posts: 967

Re: Control distance of data labels from data points in an Annotate dataset

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

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 284 views
  • 0 likes
  • 3 in conversation