Data visualization with SAS programming

Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

Dear all,

do you know whether it is possible in SAS 9.4 to get special characters into the labels on axes or panel headers in statistical graphics procedures? E.g. the below works for getting the greek character into the title, but the panel header does not resolve the ^{unicode lambda} bit and just displays that verbatim. Is there some way to make this work with SGPLOT/SGPANEL in this manner or does one need to resolve it via the choice of fonts (see second code below)?

ods escapechar="^";

data xxx;
  cat="Parameter ^{unicode lambda}";
  x=1; y=1; output;
  x=2; y=2; output;
run;
title "Parameter ^{unicode lambda}";
proc sgpanel;
  panelby cat;
  series x=x y=y;
run;

The below actually works for getting a special character into the panel header, but then I cannot add any "normal" test such as "Parameter" in a normal font, any longer.

data xxx;
  cat="l";
  x=1; y=1; output;
  x=2; y=2; output;
run;

proc sgpanel;
  panelby cat / HEADERATTRS=(family="Times New Roman Symbol");
  series x=x y=y;
run;

Does anyone have any ideas for how to get this to work so that I could have a panel header saying e.g. "Parameter λ" or "log(λ)" etc.?

Thanks for any ideas.


Accepted Solutions
Solution
‎09-08-2014 11:25 AM
SAS Super FREQ
Posts: 925

Re: Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

We support inline UNICODE escapement in any string that is specified, such as axis labels, legend labels, etc. However, we do not currently support escapement from within the data.

View solution in original post


All Replies
Super User
Posts: 11,105

Re: Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

From the online help in SAS 9.3:
^{UNICODE <unicode-value | 'unicode-value'X>}
'unicode-value'X

is syntax used with STAT/GRAPH. A hexadecimal value
is enclosed in single or double quotes followed by an X. The
X specifies that the value in quotes is a hexadecimal value. This
quoted value must be an actual four-place hexadecimal Unicode value or one of
the names listed in the Base.Template.Tagsets template. For example, 03B2 is the
Unicode value for the Alpha symbol. For
details about Unicode values, see
Using
Unicode Symbols
.

So you may need to look up the code values instead of shorthand such as Lambda

Solution
‎09-08-2014 11:25 AM
SAS Super FREQ
Posts: 925

Re: Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

We support inline UNICODE escapement in any string that is specified, such as axis labels, legend labels, etc. However, we do not currently support escapement from within the data.

Contributor
Posts: 25

Re: Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

Thanks, good to know that at the moment I cannot get it to work that way.

Occasional Learner
Posts: 1

Re: Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

Has this changed in SAS 9.4? I need special characters for my panel headers.

Super Contributor
Posts: 252

Re: Mixture of latin and greek letters in PROC SGPANEL panel headers/axes

Have you got SAS 9.4 Maintenance release 3? I believe you should be able to do that in this release.

Here is a blog from Sanjay Matange:

http://blogs.sas.com/content/graphicallyspeaking/2015/07/29/unicode-in-formatted-data-sas-9-40m3/

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 860 views
  • 0 likes
  • 5 in conversation