BookmarkSubscribeRSS Feed
kc
Quartz | Level 8 kc
Quartz | Level 8

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
Quartz | Level 8 kc
Quartz | Level 8

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
Quartz | Level 8 kc
Quartz | Level 8

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
Quartz | Level 8 kc
Quartz | Level 8

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
Quartz | Level 8 kc
Quartz | Level 8

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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4222 views
  • 0 likes
  • 3 in conversation