How can I print alphabet 'a' as superscript in xaxis label with SGPLOT on rtf output. I have tried some unicodes but none worked.
Did you try
ods escapechar='~' ;
............
~{super a}
yeah, it is generating _SUP_a_SUP_
Try running in UTF-8 encoding
You might need to use the unicode 0x1d43.
Check this link-->https://stackoverflow.com/questions/17908593/how-to-find-the-unicode-of-the-subscript-alphabet
Here's one way to do it (I haven't specifically tried it in rtf, but I assume it should work there too)...
ods escapechar='^';
proc sgplot data=sashelp.class;
scatter x=weight y=height;
xaxis label="Weight ^{unicode '1d43'x}" labelattrs=(size=20 family=Arial);
run;
I tried this but it is producing a rectangle instead of alphabet 'a' as a superscript.
The other important key is that you have to specify a Unicode font that contains that glyph. Notice in Robert's reply that he explicitly requested the "Arial" font. The font you are using might not have that glyph, which will give you a box.
Thank you, in this example, you are printing unicode text in the AXIS LABEL.
I want to be able to print unicode text in the AXIS VALUES, using a FORMAT.
That is the crucial difference, and unless somebody can prove me wrong, I don't think I can do this for the axis values.
@gabonzo - Printing superscript text in the axis values is a different topic from doing it in the axis label.
It would be best to start a new thread for that. 🙂
By the way - I used the Windows Character Map to find the numeric code for the superscript 'a' ...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: