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!
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:
Without the labelattrs=GraphUnicodeText option in the XAXIS statement the subscript 1 did not appear.
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:
Without the labelattrs=GraphUnicodeText option in the XAXIS statement the subscript 1 did not appear.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.