BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
AnnaIv
Calcite | Level 5

Dear SAS support team,

 

I have a short question regarding the labels on the graph: is it possible to use in the axis labels indices and greek letters? E.g. "C_1" and "theta".

Thank you in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @AnnaIv and welcome to the SAS Support Communities!

 

Yes, this is possible:

proc sgplot data=sashelp.class;
xaxis label="Letter C with index 1 is here: C(*ESC*){unicode '2081'x}" labelattrs=GraphUnicodeText;
yaxis label="Here is the Greek letter theta: (*ESC*){unicode theta} and a variant of it: (*ESC*){unicode '03D1'x}";
scatter x=weight y=height;
run;

(Code adapted from an example found in "Creating Oncology Figures Using ODS Graphics ..." using hex codes found in a quick internet search.)

 

Result:

unicode_labels.png

 

Without the labelattrs=GraphUnicodeText option in the XAXIS statement the subscript 1 did not appear.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @AnnaIv and welcome to the SAS Support Communities!

 

Yes, this is possible:

proc sgplot data=sashelp.class;
xaxis label="Letter C with index 1 is here: C(*ESC*){unicode '2081'x}" labelattrs=GraphUnicodeText;
yaxis label="Here is the Greek letter theta: (*ESC*){unicode theta} and a variant of it: (*ESC*){unicode '03D1'x}";
scatter x=weight y=height;
run;

(Code adapted from an example found in "Creating Oncology Figures Using ODS Graphics ..." using hex codes found in a quick internet search.)

 

Result:

unicode_labels.png

 

Without the labelattrs=GraphUnicodeText option in the XAXIS statement the subscript 1 did not appear.

AnnaIv
Calcite | Level 5
Thank you very much for quick reply! It was very helpfull!

sas-innovate-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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
  • 2 replies
  • 124 views
  • 1 like
  • 2 in conversation