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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 1831 views
  • 1 like
  • 2 in conversation