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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

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;

View solution in original post

4 REPLIES 4
ballardw
Super User

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 ).

nickpatel
Calcite | Level 5

Hi Ballardw,

 

Thank you for help. In label "Normal(i^Italicized)"  .. the part it says "Italicized" need to be Italicized.

 

Best,

Nick

DanH_sas
SAS Super FREQ

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;
nickpatel
Calcite | Level 5

hi Dan,

Thank you so much, so using annotation dataset works...

Regards,

nick

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1004 views
  • 1 like
  • 3 in conversation