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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 747 views
  • 0 likes
  • 2 in conversation