Hi all,
I have somewhat of a time-sensitive question. I am trying to produce a professional graph to include in a report. I almost have the graph looking as I want but the fonts are terrible. I would like to use Garamond bold for the title and Garamond regular for the figures in the graph. I've been told that Proc template is the way to do this. However, I don't know it and its numerous options are a bit of a pain to navigate. I was wondering if someone could take a look at the code below and make a few recomendations for how to change the font type from the default. I've attached a short data file.
best,
Cristian
Title1 "Mean and 95% CI for College Readiness (SAT-V, SAT-M, College Enrollment) for 2006-2008" ;
sgplot data=Results noautolegend ;
format col_ready_Mean Pred_Mean Lower_Mean Upper_Mean 8.2;
refline .7 / axis=x;
refline ref / lineattrs=(thickness=18) transparency=0.9;
band y=School lower=Lower_Mean upper=Upper_Mean / transparency=0.6;
scatter y=School x=Pred_Mean / markerattrs=(symbol=circlefilled) transparency=0
xerrorlower=Lower_Mean xerrorupper=Upper_Mean ;
scatter y=School x=x4 / markerchar=N x2axis;
scatter y=School x=x3 / markerchar=Pred_Mean x2axis;
scatter y=School x=x2 / markerchar=Lower_Mean x2axis;
scatter y=School x=x1 / markerchar=Upper_Mean x2axis;
xaxis display=(nolabel) grid offsetmin=0.1 offsetmax=0.32;
x2axis display=(noticks nolabel) offsetmin=0.75 offsetmax=0.05;
yaxis display=(nolabel noticks) offsetmin=0.05 offsetmax=0.05;
run;
Try this before your code and see if it works for you.
proc template;
define style styles.garamond;
parent=styles.listing; /* Or your favorite style */
style graphfonts from graphfonts /
'GraphDataFont' = ("Garamond, <MTsans-serif>",7pt)
'GraphUnicodeFont' = ("<MTsans-serif-unicode>",9pt)
'GraphValueFont' = ("Garamond, <MTsans-serif>",9pt)
'GraphLabel2Font' = ("Garamond, <MTsans-serif>",10pt)
'GraphLabelFont' = ("Garamond, <MTsans-serif>",10pt)
'GraphFootnoteFont' = ("Garamond, <MTsans-serif>",10pt)
'GraphTitleFont' = ("Garamond, <MTsans-serif>",11pt,bold)
'GraphTitle1Font' = ("Garamond, <MTsans-serif>",14pt,bold)
'GraphAnnoFont' = ("Garamond, <MTsans-serif>",10pt);
end;
run;
ods listing style=garamond;
Try this before your code and see if it works for you.
proc template;
define style styles.garamond;
parent=styles.listing; /* Or your favorite style */
style graphfonts from graphfonts /
'GraphDataFont' = ("Garamond, <MTsans-serif>",7pt)
'GraphUnicodeFont' = ("<MTsans-serif-unicode>",9pt)
'GraphValueFont' = ("Garamond, <MTsans-serif>",9pt)
'GraphLabel2Font' = ("Garamond, <MTsans-serif>",10pt)
'GraphLabelFont' = ("Garamond, <MTsans-serif>",10pt)
'GraphFootnoteFont' = ("Garamond, <MTsans-serif>",10pt)
'GraphTitleFont' = ("Garamond, <MTsans-serif>",11pt,bold)
'GraphTitle1Font' = ("Garamond, <MTsans-serif>",14pt,bold)
'GraphAnnoFont' = ("Garamond, <MTsans-serif>",10pt);
end;
run;
ods listing style=garamond;
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.
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.