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: Call for Content

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!

Submit your idea!

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