Data visualization with SAS programming

Labels on reference lines

Reply
Occasional Contributor
Posts: 16

Labels on reference lines

Hello,

In the gplot graph that I am producing, I would like to include 5 reference (vref) lines. I would like to label each reference line with text i.e. "id1" "id2" "id3" etc.
Is there any way I can do this?

Thanks in advance,
Natanya
Valued Guide
Posts: 632

Re: Labels on reference lines

You are looking for the REFLABEL= option on the AXIS statement. You can find an example at:
http://caloxy.com/papers/61_133_30.pdf
Occasional Contributor
Posts: 16

Re: Labels on reference lines

Thanks ArtC. This is great.
Is there a way to control where the labels of the reference lines go? i.e. can I put them sideways? or in the middle of the line? on the left or right? top or bottom?
Thanks.
Valued Guide
Posts: 632

Re: Labels on reference lines

You can use the justify= option to move the text some [left, right, center].
[pre]
axis1 reflabel=(t=1 j=left '100' j=left 'LBS');
[/pre]
For vertical text consider using the a=90 and a=-90 options.
Text can also be placed with the TITLE, FOOTNOTE, and NOTE statements, which support the MOVE= option to place text exactly.
If you need to do too very much more you may need to use ANNOTATE which is very flexible.
Occasional Contributor
Posts: 16

Re: Labels on reference lines

Thanks for your help,
I will work with these options. At this point annotate is too threatening.
Valued Guide
Posts: 632

Re: Labels on reference lines

Good luck
Annotate need not be so hard to learn. The documentation is good, there are a number of good papers, and of course my unbiased favorite is the book:
Annotate Simply the Basics
https://support.sas.com/pubscat/bookdetails.jsp?pc=57320
Occasional Contributor
Posts: 16

Re: Labels on reference lines

Hi Art,
Thank you for your links. I did take the plunge and worked a bit with annotate. I used one of your documents that I found online. It was very clearly written and very helpful. I am sure that as I move forward I will have more questions, but meanwhile thanks for your help.
Natanya
Ask a Question
Discussion stats
  • 6 replies
  • 258 views
  • 0 likes
  • 2 in conversation