Hello SAS Users,
I am creating a Forest Plot for a project and have followed Sanjay's examples to do this. However, I am trying to change the font of the forest plot tick marks to Times New Roman so that the resulting figure looks consistent with the rest of the production work.
A snippet of the code I have so far is:
layout overlay / xaxisopts=(label=' ' type=linear linearopts=(tickvaluepriority=true tickvaluelist=(0.0 0.5 1.0 1.5 2.0 2.5 3.0)))
yaxisopts=(reverse=true display=none) walldisplay=none;
highlowplot y=RECID low=RATIO_LCL high=RATIO_UCL;
scatterplot y=RECID x=RATIO / markerattrs=(symbol=squarefilled) ;
referenceline x=1;
endlayout;
The plot looks like below (no numerical data shown). I'm not sure what option will change the font family. Any guidance is appreciated.
Thank you @ballardw! The option TICKVALUEATTRS worked when I placed it within the XAXISOPTS.
The option TICKVALUEATTRS=(Family= "<name of font family goes here>") as part of the Linearopts should do it.
@DukeStats wrote:
Hello SAS Users,
I am creating a Forest Plot for a project and have followed Sanjay's examples to do this. However, I am trying to change the font of the forest plot tick marks to Times New Roman so that the resulting figure looks consistent with the rest of the production work.
A snippet of the code I have so far is:
layout overlay / xaxisopts=(label=' ' type=linear linearopts=(tickvaluepriority=true tickvaluelist=(0.0 0.5 1.0 1.5 2.0 2.5 3.0)))
yaxisopts=(reverse=true display=none) walldisplay=none;
highlowplot y=RECID low=RATIO_LCL high=RATIO_UCL;
scatterplot y=RECID x=RATIO / markerattrs=(symbol=squarefilled) ;
referenceline x=1;
endlayout;The plot looks like below (no numerical data shown). I'm not sure what option will change the font family. Any guidance is appreciated.
Thank you @ballardw! The option TICKVALUEATTRS worked when I placed it within the XAXISOPTS.
proc template;
define style styles.garamond;
parent=styles.listing; /* Or your favorite style */
style graphfonts from graphfonts /
'GraphDataFont' = ("TimesNewRoman, <MTsans-serif>",7pt)
'GraphUnicodeFont' = ("<MTsans-serif-unicode>",9pt)
'GraphValueFont' = ("TimesNewRoman, <MTsans-serif>",9pt)
'GraphLabel2Font' = ("TimesNewRoman, <MTsans-serif>",10pt)
'GraphLabelFont' = ("TimesNewRoman, <MTsans-serif>",10pt)
'GraphFootnoteFont' = ("TimesNewRoman, <MTsans-serif>",10pt)
'GraphTitleFont' = ("TimesNewRoman, <MTsans-serif>",11pt,bold)
'GraphTitle1Font' = ("TimesNewRoman, <MTsans-serif>",14pt,bold)
'GraphAnnoFont' = ("TimesNewRoman, <MTsans-serif>",10pt);
end;
run;
ods listing style=garamond;
ods html style=garamond;
proc sgplot data=sashelp.class;
scatter x=weight y=height/group=sex datalabel=name;
run;
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.