data sample;
input x y;
datalines;
1 10
2 20
3 15
4 25
5 30
;
ods rtf file="\\Desktop\RC\test.rtf" bodytitle_aux image_dpi = 300 nogfootnote nogtitle;
ods escapechar = '^';
/* Create a scatter plot with a custom Y-axis label */
proc sgplot data=sample;
scatter x=x y=y / markerattrs=(symbol=circlefilled);
yaxis label="Normal(i^Italicized)" labelattrs=(size=12 );
run;
ods _all_ close;
Rich-text functionality is not currently supported in axis labels. You'll need to use annotation to do it. Something like the following:
data axislabel;
retain drawspace "wallpercent" x1 -7.5 y1 50 rotate 90 textsize 12 width 50;
input function $ textstyle $ label $ 17-26;
cards;
text normal Normal
textcont italic Italicized
;
run;
proc sgplot data=sample sganno=axislabel pad=(left=30);
scatter x=x y=y / markerattrs=(symbol=circlefilled);
yaxis display=(nolabel);
run;
First tell exactly which part of the label is to be in italics.
It isn't really clear from your code. Generally any modifier to text appearance come before the actual text to modify. So your attempt would possibly only effect a closing ).
Hi Ballardw,
Thank you for help. In label "Normal(i^Italicized)" .. the part it says "Italicized" need to be Italicized.
Best,
Nick
Rich-text functionality is not currently supported in axis labels. You'll need to use annotation to do it. Something like the following:
data axislabel;
retain drawspace "wallpercent" x1 -7.5 y1 50 rotate 90 textsize 12 width 50;
input function $ textstyle $ label $ 17-26;
cards;
text normal Normal
textcont italic Italicized
;
run;
proc sgplot data=sample sganno=axislabel pad=(left=30);
scatter x=x y=y / markerattrs=(symbol=circlefilled);
yaxis display=(nolabel);
run;
hi Dan,
Thank you so much, so using annotation dataset works...
Regards,
nick
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.