BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Garnett
Obsidian | Level 7

Greetings! 

I can write within PROC TEMPLATE:

layout overlay / yaxisopts=(label = "p((*ESC*){unicode theta})") ;

I'd like the symbol theta (and only theta) to appear in italics. How can I do this? v9.4

Thanks very much in advance!

Garnett

1 ACCEPTED SOLUTION

Accepted Solutions
Garnett
Obsidian | Level 7

Hi there! 

Thanks for your reply. The challenge is italicizing theta without italicizing "P("  and ")". Apparently it cannot be done.

 

I received a reply from tech support, pasted below:

---------------------------------------------------------------------------------------------------------------------------

Garnett,

 

There is not an option to italicize only a portion of an axis label.  The text style applies to the entire label.

 

You can use a DRAWTEXT statement to place the text on the graph to simulate the label.

 

Below is a simple sample that will suppress the default Y axis label and use the DRAWTEXT statement to place text to the left of the graph.  The PAD= option on the BEGINGRAPH statement adds space to the left of the graph where we want the text to be placed.  You might need to adjust the PAD= value, depending on how the text looks on your graph.

 

 

proc template;

  define statgraph plot;

    begingraph / pad=( left=5%);

     layout overlay / yaxisopts=(display=(ticks tickvalues line));

       scatterplot x=age y=height;

 

       drawtext textattrs=(style=normal) "P" textattrs=(style=italic) "(*ESC*){unicode theta}" / xspace=graphpercent yspace=wallpercent x=2 y=50

           rotate=90 anchor=center width=50;

 

     endlayout;

   endgraph;

  end;

run;

proc sgrender data=sashelp.class template=plot;

run;

 

 

View solution in original post

2 REPLIES 2
sdengland
SAS Employee

Give this a try:

layout overlay / 
   yaxisopts=(label = "(*ESC*){unicode theta}" labelattrs=(style=italic size=12pt));

To make it bold, add weight=bold to labelattrs=.

 

Garnett
Obsidian | Level 7

Hi there! 

Thanks for your reply. The challenge is italicizing theta without italicizing "P("  and ")". Apparently it cannot be done.

 

I received a reply from tech support, pasted below:

---------------------------------------------------------------------------------------------------------------------------

Garnett,

 

There is not an option to italicize only a portion of an axis label.  The text style applies to the entire label.

 

You can use a DRAWTEXT statement to place the text on the graph to simulate the label.

 

Below is a simple sample that will suppress the default Y axis label and use the DRAWTEXT statement to place text to the left of the graph.  The PAD= option on the BEGINGRAPH statement adds space to the left of the graph where we want the text to be placed.  You might need to adjust the PAD= value, depending on how the text looks on your graph.

 

 

proc template;

  define statgraph plot;

    begingraph / pad=( left=5%);

     layout overlay / yaxisopts=(display=(ticks tickvalues line));

       scatterplot x=age y=height;

 

       drawtext textattrs=(style=normal) "P" textattrs=(style=italic) "(*ESC*){unicode theta}" / xspace=graphpercent yspace=wallpercent x=2 y=50

           rotate=90 anchor=center width=50;

 

     endlayout;

   endgraph;

  end;

run;

proc sgrender data=sashelp.class template=plot;

run;

 

 

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 16. 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
  • 2 replies
  • 1027 views
  • 0 likes
  • 2 in conversation