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
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;
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=.
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.