BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ullhvi
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SuzanneDorinski
Lapis Lazuli | Level 10

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. 

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

http://www2.sas.com/proceedings/forum2007/099-2007.pdf

Ksharp
Super User

Try 

 

ods escapechar='^';

proc sgplot .......

histogram 

 

And better post it at ODS Graphic Forum, I can bet you can get the right answer .

SuzanneDorinski
Lapis Lazuli | Level 10

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. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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