BookmarkSubscribeRSS Feed
kc
Obsidian | Level 7 kc
Obsidian | Level 7

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

9 REPLIES 9
Cynthia_sas
SAS Super FREQ
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
DanH_sas
SAS Super FREQ

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

 

Thanks!
Dan

kc
Obsidian | Level 7 kc
Obsidian | Level 7

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;

 

DanH_sas
SAS Super FREQ

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

kc
Obsidian | Level 7 kc
Obsidian | Level 7

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. 

DanH_sas
SAS Super FREQ

What version of SAS are you using?

kc
Obsidian | Level 7 kc
Obsidian | Level 7

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

DanH_sas
SAS Super FREQ

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

kc
Obsidian | Level 7 kc
Obsidian | Level 7

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 4162 views
  • 0 likes
  • 3 in conversation