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.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 1447 views
  • 1 like
  • 2 in conversation