BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm trying to do a line graph in gplot and put the values into the chart for each point.

I got the values but can't seem to get the text rotated into a vertical direction.

what is the best way to do this?
6 REPLIES 6
GraphGuy
Meteorite | Level 14
Are you using "pointlabels" or "annotated text"?

And what version of SAS are you using?
deleted_user
Not applicable
I'm looking into pointlabels but I don't see any way of rotating the text
GraphGuy
Meteorite | Level 14
If you've got the latest v9.2, you can rotate pointlabels as follows. Pointlabels were enhanced in v9.2, and I'm not sure if this capability was available in earlier releases.

(I strongly encourage everyone to use the latest/greatest version of SAS/Graph, because there are always lots of nice fixes & features added in each version!)


symbol1 v=dot i=none pointlabel=(h=8pt a=90 "#name");
proc gplot data=sashelp.class;
plot height*weight=1;
run;
deleted_user
Not applicable
unfortunately I'm running 9.1 (can't upgrade)

I tried a=90 and that rotated the labels (there was nothing in the documentation about this).

I'm managed to rotate the labels with
symbol1 color=red interpol=join v=dot height=.75
POINTLABEL=(a=90 c=red h=.75 J=C POSITION=TOP f="Arial") ;

but I noticed something....the labels are not always above the point plotted
GraphGuy
Meteorite | Level 14
It's a little difficult to predict & control the exact placement of pointlabel text, with interactions of things like rotate and collision-avoidance, etc.

Therefore you might prefer to annotate the text labels on the points, such as...


data my_anno; set sashelp.class;
xsys='2'; ysys='2'; hsys='3';
function='label'; position='6'; angle=90;
x=weight; y=height;
text=' '||trim(left(name));
run;

goptions reset=symbol;
symbol1 v=dot i=none;
proc gplot data=sashelp.class anno=my_anno;
plot height*weight=1;
run;
deleted_user
Not applicable
thanks

that worked

I was trying to avoid anything like that because I probably will need to give the final program to others to use and I did not want to use anything that they have not seen before.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1890 views
  • 1 like
  • 2 in conversation