BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
DukeStats
Calcite | Level 5

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.

DukeStats_0-1691020572912.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
DukeStats
Calcite | Level 5

Thank you @ballardw! The option TICKVALUEATTRS worked when I placed it within the XAXISOPTS. 

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

DukeStats_0-1691020572912.png

 


 

DukeStats
Calcite | Level 5

Thank you @ballardw! The option TICKVALUEATTRS worked when I placed it within the XAXISOPTS. 

Ksharp
Super User


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;

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 882 views
  • 0 likes
  • 3 in conversation