BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Chaupak
Obsidian | Level 7

Hi, I was trying to draw a series plot by group and display the every group's name in the legend. One of the groups represents a range "<= xx mg". However, I want its label to be displayed as the sepcial character of less than or equal to sign instead of the combination of "<" and "=" in the plot. This is the sample data and code:

 

DATA plot;
INPUT year value group$;
CARDS;
1 10 <=50
2 15 <=50
3 20 <=50
4 25 <=50
5 30 <=50
1 10 >50
2 30 >50
3 50 >50
4 70 >50
5 90 >50
;

proc sgplot data=plot;
    series x=year y=value / group=group;
run;

I've tried to replace with "(*ESC*){unicode '2264'x} 50" in the dataset, but it didn't work in PROC SGPLOT. Is there any way to display the right special character in the plot?

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19
proc format;
   value $group '<=50' = "(*ESC*){unicode '2264'x} 50";
   quit;
proc sgplot data=plot;
    series x=year y=value / group=group;
    format group $group.;
run;

View solution in original post

2 REPLIES 2
data_null__
Jade | Level 19
proc format;
   value $group '<=50' = "(*ESC*){unicode '2264'x} 50";
   quit;
proc sgplot data=plot;
    series x=year y=value / group=group;
    format group $group.;
run;
Chaupak
Obsidian | Level 7

Thank you so much! It's perfect.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 803 views
  • 1 like
  • 2 in conversation