Data visualization with SAS programming

insert ods escapechar syntax in a graph title

Reply
N/A
Posts: 0

insert ods escapechar syntax in a graph title

Hello,
if i submit the following code:
ods escapechar="^";
title " x^{super 3}";

proc sgplot data=sashelp.class;
scatter x= height y= weight;
run;
it's written in my log SUPER FUNCTION NOT DEFINED IN THIS TAGSET

How can i do to define my super function to write my title as i want ?

Thank you
have a nice week end in few hours
SAS Super FREQ
Posts: 925

Re: insert ods escapechar syntax in a graph title

Change SUPER to SUP and it should work for you.

Thanks!
Dan
SAS Super FREQ
Posts: 925

Re: insert ods escapechar syntax in a graph title

My apologies, I misspoke. The SG procedures support the UNICODE function inline with the title (and other strings) but not super and sub. You can get around this by specifying NOGTITLE on your ODS HTML statement.

Thanks!
Dan
SAS Super FREQ
Posts: 8,814

Re: insert ods escapechar syntax in a graph title

Hi:
Here's an example that shows the way to use unicode characters for super/subscript in "classic" SAS/GRAPH and using SG procedures. (There are other ways with classic SAS/GRAPH to insert super/sub scripts with MOVE commands in the title, but these methods are much easier.) Refer to Windows Character Map or any other list of UNICODE characters to find out the values for other numbers. Note that many of the values for super/sub unicode characters start in the 20xx range and not the 00xx range.

Thanks, Dan for helping on the SGPLOT example!

cynthia
[pre]
ods listing close;
**1) Using Unicode font with hex characters in "classic SAS/GRAPH";
ods html file='testuni_sasgraph92.html' style=analysis;

title h=14pt 'superscript one' f='Arial Unicode MS/unicode' '00B9'x;
title3 h=14pt 'superscript three' f='Arial Unicode MS/unicode' '00B3'x;
footnote "version: &sysvlong4";

proc gplot data=sashelp.class;
plot height*weight;
run;
quit;
ods _all_ close;
title; footnote;

**2) Using UNICODE function with SG Procedures;
ods html file='testuni_sgproc92.html' style=analysis;
ods escapechar='^';
title h=14pt "superscript one ^{unicode '00B9'x}";
title3 h=14pt "superscript three ^{unicode '00B3'x}";
footnote "version: &sysvlong4";

proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
ods _all_ close;
title; footnote;
[/pre]
Ask a Question
Discussion stats
  • 3 replies
  • 378 views
  • 0 likes
  • 3 in conversation