BookmarkSubscribeRSS Feed
Snehal
Obsidian | Level 7

How can I print alphabet 'a' as superscript in xaxis label with SGPLOT on rtf output. I have tried some unicodes but none worked.

11 REPLIES 11
Ksharp
Super User

Did you try 

 

ods escapechar='~' ;

 

............

~{super  a}

Snehal
Obsidian | Level 7

yeah, it is generating _SUP_a_SUP_

SuryaKiran
Meteorite | Level 14

Try running in UTF-8 encoding

Thanks,
Suryakiran
SuryaKiran
Meteorite | Level 14

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

Thanks,
Suryakiran
Jay54
Meteorite | Level 14
Axis label does not support SUP or SUB commands. It does support straight Unicode. If you can find built-in unicode symbol for superscript a, you can use it. Else, you need to use Annotate or, for simple case, use the Footnote.
GraphGuy
Meteorite | Level 14

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;

 

foo.png

Snehal
Obsidian | Level 7

I tried this but it is producing a rectangle instead of alphabet 'a' as a superscript.

DanH_sas
SAS Super FREQ

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.

gabonzo
Quartz | Level 8

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.

 

 Original thread 

 

 

GraphGuy
Meteorite | Level 14

@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. 🙂

GraphGuy
Meteorite | Level 14

By the way - I used the Windows Character Map to find the numeric code for the superscript 'a' ...

 

unicode_a.png

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 11 replies
  • 7458 views
  • 7 likes
  • 7 in conversation