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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 376 views
  • 4 likes
  • 3 in conversation