Hi,
I am trying to do a simple histogram form the following:
proc univariate data=xxx noprint;
histogram pm25;
label pm25 'Baseline PM2.5, µg/m³';
run;
I would like the '2.5' in the label to be subscript characters
I have tried the
ods escapechar="^";
...
label pm25 'Baseline PM^(sub 2.5), µg/m³';
but get the error "SUB FUNCTION NOT DEFINED IN THIS TAGSET"
The superscript m³ was obtained by the alt code "ALT+ 0179" but for some reason the corresponding subscript alt codes do not work?
Any suggestions?
You can try this bit of code:
ods escapechar='^';
proc sgplot data=xxx;
histogram pm25;
xaxis label="Baseline PM^{unicode '2082'x}^{unicode '2024'x}^{unicode '2085'x}, ^{unicode mu}g/m^{unicode '00B3'x}"
labelattrs=GraphUnicodeText;
run;
Read The Power of Unicode for more details.
What is your destination? Is it the output window - is that text or html? Text can't really do that. Is it rtf? Excel etc?
You can put superscripts and subscripts in using escape codes where the destination supports them.
Try
ods escapechar='^';
proc sgplot .......
histogram
And better post it at ODS Graphic Forum, I can bet you can get the right answer .
You can try this bit of code:
ods escapechar='^';
proc sgplot data=xxx;
histogram pm25;
xaxis label="Baseline PM^{unicode '2082'x}^{unicode '2024'x}^{unicode '2085'x}, ^{unicode mu}g/m^{unicode '00B3'x}"
labelattrs=GraphUnicodeText;
run;
Read The Power of Unicode for more details.
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.
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.