Data visualization with SAS programming

Italicize one letter of axis label

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

Italicize one letter of axis label

[ Edited ]

I am adding an axis label to a panel of plots created using layout lattice.

 

The axis label needs to read "Coefficient (I2)" with the I italicized and the 2 superscript.

 

I am able to superscript the 2 using the following code, but I can't seem to get the I italicized.  I am using SAS 9.3.

 

ENTRY 'Coefficient (I(*ESC*){unicode "00B2"x})'


Accepted Solutions
Solution
‎12-06-2016 09:24 AM
SAS Super FREQ
Posts: 1,044

Re: Italicize one letter of axis label

You can use a LABEL option on XAXISOPTS as shown below with SGPLOT.  This will also work for ENTRY.

 

ods escapechar '~';
proc sgplot data=sashelp.class;
vbar age;
xaxis label="Coefficient (i ~{unicode '00B2'x} )" labelattrs=(style=italic);
run;

View solution in original post


All Replies
Solution
‎12-06-2016 09:24 AM
SAS Super FREQ
Posts: 1,044

Re: Italicize one letter of axis label

You can use a LABEL option on XAXISOPTS as shown below with SGPLOT.  This will also work for ENTRY.

 

ods escapechar '~';
proc sgplot data=sashelp.class;
vbar age;
xaxis label="Coefficient (i ~{unicode '00B2'x} )" labelattrs=(style=italic);
run;

Contributor
Posts: 28

Re: Italicize one letter of axis label

Thank you Sanjay; as always, your solution worked perfectly!

Post a Question
Discussion Stats
  • 2 replies
  • 128 views
  • 0 likes
  • 2 in conversation