BookmarkSubscribeRSS Feed
martyvd
Fluorite | Level 6
I am specifying 8 pt font for my bar graph, but when I open the resulting PDF file I can see that the data value labels are only 7.59 pt and the legend value labels are 7.2pt. I thought it might be a result of using the scale=on option, but when I change it to scale=off, the font sizes are all 9.09 pt. I've included my code below and attached the PDF output. 

 

proc template;
define style Custombar;
parent = Styles.Default; 
class graphaxislines/contrastcolor=black linethickness=0.75pt;
class graphbackground/color=white;
class graphwalls/frameborder=off;
class graphborderlines/contrastcolor=white linethickness=0;
class graphlabeltext/fontfamily=Arial fontsize=8pt;
class graphvaluetext/fontfamily=Arial fontsize=8pt;
class body/backgroundcolor=white;
end;
run;

PROC IMPORT OUT= WORK.age DATAFILE= "E:\SAS figures\Age data.xlsx" 
            DBMS=xlsx REPLACE;
     		GETNAMES=YES;
RUN;

ods _all_ close;
options nonumber nodate orientation=landscape papersize=letter nocenter
leftmargin=.5in rightmargin=.5in topmargin=.5in bottommargin=.5in;
ods pdf file="E:/SAS figures/fig2_pdf.pdf" dpi=300 notoc accessible=on;
ods pdf style=Custombar;
ods graphics/border=off;
ods graphics on/reset=all width=6.5in scale=on ANTIALIASMAX=100000;

proc sgplot data=age noborder nowall;
styleattrs datacolors=('#0060A9' '#00a2e5' '#6dc069' '#ffc222');
vbar Year / response=Percent group=Group grouporder=data groupdisplay=stack clusterwidth=1.0 barwidth=0.6 nooutline baselineattrs=(thickness=0);
xaxis discreteorder=data display=(nolabel noticks) valueattrs=(family=Arial size=8.5pt);
yaxis label="Percent of all admissions aged 12 and older" values=(0 to 100 by 20) display=(noticks) labelattrs=(family=Arial size=8pt weight=normal) valueattrs=(family=Arial size=8pt);
keylegend/title="" valueattrs=(family=Arial size=8pt) noborder scale=1.25 autooutline linelength=30 fillaspect=golden;
run;

ods graphics off;
ods pdf close;
 
 
 
 
1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:
It was my understanding from the early days of ODS PDF that using the Microsoft name of just "Arial" was not a good practice with ODS PDF. When I can't use Helvetica for ODS PDF and someone insists on Arial, for ODS PDF I always use "Arial Unicode MS" as the name of the Adobe font that corresponds to Microsoft Arial.
Otherwise, for issues with font rendering, especially in Graphics, you might want to open a track with Tech Support.
Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1 reply
  • 906 views
  • 1 like
  • 2 in conversation