BookmarkSubscribeRSS Feed
Davejones
Obsidian | Level 7

Hi experts,

 

ods escapechar = '^';

title 'LT^{sub 50}';

 

I used above to successfully add the subscript 50 to the title LT50, but was not able to Y axis variable/legend in PDF output figures. How to do it?

 

Thanks,

8 REPLIES 8
Davejones
Obsidian | Level 7
used
Label Female_LT50 = 'Female LT^{sub 50}';
Showed in Y axis
Female LT__SUB_50_SUB__
DanH_sas
SAS Super FREQ

Assuming you are using the SGPLOT procedure, you can do it this way:

 

yaxis label="Female_LT^{unicode '2085'x}^{unicode '2080'x}";

 

You might also need to specify a different font, depending on whether the font you are using support these Unicode values. I would recommend the following if you have this font issue:

 

yaxis label="Female_LT^{unicode '2085'x}^{unicode '2080'x}" valueattrs=(family="Arial Unicode MS");

 

Hope this helps!

Dan

 

Davejones
Obsidian | Level 7

Hi Dan,

 

Thank you for your help and I'm using ODS style=statistical, proc GLM data=LT50 plots all; not SGPLOT

_____

%Macro LT50(var1, var2);
proc glm data=LT50 plots=all;
model &var1=&var2;
run;

_________

 

Davejones
Obsidian | Level 7

Ksharp,

 

Thanks and I actually want to change "50" to subscript in the variables "LT50" in y axis in the proc GLM?

 

Best,

 

Dave

Ksharp
Super User
data _anno;
length label $ 200;
 drawspace="layoutpercent"; function="text"; textweight="normal"; textsize=12;textcolor="black"; width=200;
 x1=2;y1=50;rotate=90;label="LT(*ESC*){sub '50'}"; output;
 run;
proc sgplot data=sashelp.class sganno=_anno;
reg x=weight y=height/clm cli;
yaxis label=' ';
run;

Ksharp_0-1676461889003.png

 

Davejones
Obsidian | Level 7

Thanks and can those code be used for proc GLM, PLOTS=ALL, not a proc sgplot?

Ksharp
Super User
No, it is not.
But you can make a output dataset by OUTPUT OUT= of PROC GLM . And using PROC SGPLOT to get what you want.

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
  • 1085 views
  • 4 likes
  • 3 in conversation