Data visualization with SAS programming

superscript on axis

Reply
Contributor
Posts: 74

superscript on axis

Using ods rtf as output, how to apply superscript to the axis name? I tried {\super } and seems that axis doesnt recognize it. I am using proc boxplot and proc gplot.
SAS Employee
Posts: 980

Re: superscript on axis

If it's a simple 1-character superscript that happens to have a character in the font you're using, you can specify the hex-code for that character, like this:

axis1 label=(font="arial" "Squared" 'b2'x);

proc gplot data=sashelp.class;
plot height*weight / vaxis=axis1;
run;
Respected Advisor
Posts: 3,788

Re: superscript on axis

That's a good tip, thanks. To get it to work properly with a=90 angled axis you need to include 'b2'x in the string with "Squared". The byte function is handy for that.


[pre]
axis1 label=(a=90 h=14pt font="arial" "Squared%sysfunc(byte(178),$1.)");

proc gplot data=sashelp.class;
plot height*weight / vaxis=axis1;
run;
quit;
[/pre]
Frequent Contributor
Posts: 128

Re: superscript on axis

@data_null_;

It works great for me. It fixed the problem happens when a=90. Thanks!!
but could you tell me what do 178 $1. mean?

Ken
SAS Super FREQ
Posts: 925

Re: superscript on axis

This tip from Robert also works for the SG procedures:

proc sgplot data=sashelp.class;
yaxis label="X(*ESC*){unicode '00b2'x}";
vbar age;
run;
Contributor
Posts: 74

Re: superscript on axis

thank you all very much. too bad the font I am using doesnt support it. I wanted a 'square' sign, cm^2.
Ask a Question
Discussion stats
  • 5 replies
  • 1098 views
  • 1 like
  • 5 in conversation