BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
_Hopper
Obsidian | Level 7

I have a vector plot with annotations, but the footnotes overlap the x-axis annotations. 

1. Is there a workaround for this?

2. The font for the x-axis labels does not change even though I changed in the annotation dataset. Any suggestions?

 


data anno;
length x1space $11 textweight label $100;
x1space='datavalue';
y1space='wallpercent';
function='text';
textcolor='black';
anchor='top';
fontsize = '6pt';
font = 'Courier New';
array lux[10] lux1-lux10 (999 500 178 63 22 8 3 1 .35 .125);
do x1=8 to 17 ;
fontsize = '6pt';
font = 'Courier New';
y1=-1;
label=compress(put(x1,6.));
output;
y1=-5;
if lux[x1-7] = 999 then label = ">500";else
if lux[x1-7] >=1 then label=compress(put(lux[x1-7],6.));else
if lux[x1-7] = .35 then label = '0.35';else
if lux[x1-7] = .125 then label ='0.125';

output;
/* y1=-9;*/
/* label='Lux';*/
/* output;*/
end;
x1space='datapercent';
x1=50;
y1=-14;
label='Score / Lux';
textweight='normal';
fontsize = '6pt';
font = 'Courier New';
output;
run;

 

 

_Hopper_0-1732641429596.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

The default ANCHOR for text is CENTER. For your footnote text, you will want to set the ANCHOR to be BOTTOMLEFT. That way, the footnote length can grow and shrink but never move on the left side.

View solution in original post

8 REPLIES 8
DanH_sas
SAS Super FREQ

I can't see all of your code, but I think the following is your solution:

  1. Instead of using the FOOTNOTE statement, add it to you annotation. On the SGPLOT statement, specify PAD=(BOTTOM=20px) (change the value to taste) to create space at the bottom of your plot for the annotations.
  2. I believe you are using the incorrect column name for your TEXT attribute specifications. Use TEXTFAMILY, TEXTSIZE, TEXTWEIGHT, TEXTSTYLE, and TEXTCOLOR. The easiest way to remember this is that the names line up with the TEXT function name.

Hope this helps!

 

_Hopper
Obsidian | Level 7

Dan:

 

That helped quite a bit. Regarding how you position text.
One footnote was considerably longer than the other. I used layoutpercent and then had to use an X1 value of 12 with the shorter text and an X1 value of 40 with the longer text. I thought that the X1 value of say 10 would get me what I want. But when I did this, the annotation text ran off the left margin.

 

How does this work?

DanH_sas
SAS Super FREQ

The default ANCHOR for text is CENTER. For your footnote text, you will want to set the ANCHOR to be BOTTOMLEFT. That way, the footnote length can grow and shrink but never move on the left side.

_Hopper
Obsidian | Level 7

Dan,

 

On a related item. This particular vector plot has no legend. However, my starting value is represented by a circle and the ending value is represented by an arrow. Can this be done with a keylegend statement or does it have to be done with annotations?

DanH_sas
SAS Super FREQ

Use two LEGENDITEM statements (one for each item) and add them (by name) to your KEYLEGEND like you would a plot. Let me know if you cannot find an example of this technique.

DanH_sas
SAS Super FREQ

For the arrow, use a "right triangle" marker as the arrow in the LEGENDITEM definition.

_Hopper
Obsidian | Level 7
Thanks Dan. The suggestions were really helpful.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 8 replies
  • 513 views
  • 2 likes
  • 2 in conversation