Data visualization with SAS programming

Proc sgplot and graph fonts

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Proc sgplot and graph fonts

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;

Attachment

Accepted Solutions
Solution
‎04-12-2012 02:22 PM
SAS Super FREQ
Posts: 864

Re: Proc sgplot and graph fonts

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;


View solution in original post


All Replies
Solution
‎04-12-2012 02:22 PM
SAS Super FREQ
Posts: 864

Re: Proc sgplot and graph fonts

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;


Post a Question
Discussion Stats
  • 1 reply
  • 3649 views
  • 0 likes
  • 2 in conversation