Data visualization with SAS programming

ODS RTF ≥ symbol in a plot

Reply
Occasional Contributor kc
Occasional Contributor
Posts: 14

ODS RTF ≥ symbol in a plot

I am trying to display the ≥ symbol (greater than or equal to) on y-axis in a plot using the sgplot procedure. But, the ≥ symbol is replaced by just the = symbol in the RTF document produced. The ≥ symbol is part of a string in a character variable.

 

Any suggestions?

 

Thanks,

KC

SAS Super FREQ
Posts: 8,820

Re: ODS RTF ≥ symbol in a plot

Hi:
You might want to post this question in the ODS Graphics forum with some of your data and code. This blog by Sanjay Matange shows using Unicode characters in an inset box. Perhaps you can modify this technique for your plot.

http://blogs.sas.com/content/graphicallyspeaking/?s=unicode+legend

cynthia
SAS Super FREQ
Posts: 925

Re: ODS RTF ≥ symbol in a plot

Can you post just the SGPLOT code you are using, along with any TITLE and FOOTNOTE statements.

 

Thanks!
Dan

Occasional Contributor kc
Occasional Contributor
Posts: 14

Re: ODS RTF ≥ symbol in a plot

Here is the sgplot code and the proc format code (no titles or footnote statements)

 

proc format library=work;
value yscale 200 = 'Treatment'
160 = 'Age ^{unicode 2265} 75'
140 = 'Age < 75'
100 = 'US'
80 = 'Outside US'
other = ''
;
run;


ods options orientation=portrait;
ODS ESCAPECHAR='^';
ods graphics on / border=off;
ods rtf file='C:\Users\Z1000\Desktop\newplot.rtf' sge=on;
proc sgplot data=combined sganno=anno;
scatter x=meanestimate y=Order / xerrorlower=MeanLowerCL xerrorupper=MeanUpperCL markerattrs=OR (symbol=DiamondFilled size=6);
refline 1/axis=x;
format Order yscale.;
xaxis label="Relative Rate" LABELATTRS=(Family='Arial' ) VALUEATTRS=(Family=Arial SIZE=10 ) type=LOG LOGBASE= 10 min=0.5 max=2 values = (0.5 1 2);
yaxis label="SubGroups" display=(nolabel) tickvalueformat=yscale. VALUEATTRS=(Family=Arial SIZE=10 ) offsetmin=0.1 offsetmax=0.1 VALUES = (80 100 140 160 200);
run;
ods rtf close;

 

SAS Super FREQ
Posts: 925

Re: ODS RTF ≥ symbol in a plot

Instead of using ODS ESCAPECHAR, you must use the default escape sequence, which is (*ESC*). There were issues with using user-defined ESCAPECHARs in the PROC FORMAT context. Plus, by using the default sequence, you are guaranteed that the format stored in the catalog will always work, regardless of how your program defines ESCAPECHAR. Let me know if that works for you.

 

Thanks!
Dan

Occasional Contributor kc
Occasional Contributor
Posts: 14

Re: ODS RTF ≥ symbol in a plot

Hi Dan,

 

I tried using the default escape sequence, but with no luck. The symbol does show up as its supposed to in the title and footnote statements no matter which escape sequence I use, but just not as an axis value for some reason. 

SAS Super FREQ
Posts: 925

Re: ODS RTF ≥ symbol in a plot

What version of SAS are you using?

Occasional Contributor kc
Occasional Contributor
Posts: 14

Re: ODS RTF ≥ symbol in a plot

I am using SAS 9.4 (TS1M1) - Do I need TS1M3 for the code to work (I see that on some blogs)?

SAS Super FREQ
Posts: 925

Re: ODS RTF ≥ symbol in a plot

Yes, that is the issue. It was a recent development.

Occasional Contributor kc
Occasional Contributor
Posts: 14

Re: ODS RTF ≥ symbol in a plot

Thanks Dan! I should have probably mentioned that along with the code.Will try and see if the code works after upgrading to TS1M3 release.

Ask a Question
Discussion stats
  • 9 replies
  • 600 views
  • 0 likes
  • 3 in conversation