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 2024

Innovate_SAS_Blue.png

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. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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