1
votes

I hope you can help. I would like to reduce the amount of white space that SAS adds between the bottom of a graph and the footnote. I'm generating graphs into .pdf files that need to meet certain requirements in terms of having a minimum margin (that I've specified in the options statement) and with the left justified titles and footnotes. As more titles and footers get added it seems that the amount of white space increases disproportionately. I would also like to extend the left and right length of the graph. I have tried playing with width and height options in the ods graphics statement amongst many other things.
Code using sashelp.esno below. Any insight appreciated.

options nodate nonumber pageno=1 pagesize=43 linesize=108 orientation=landscape papersize=LETTER LEFTMARGIN=0.87in RIGHTMARGIN=0.87in TOPMARGIN=1.25in BOTTOMMARGIN=1.25in;

/*Note: US letter measures 8.5 by 11.0 inches (215.9 by 279.4 mm). */
ods graphics off;
run;
ods _all_ close;
ods graphics  on / reset=all width=9in height=4.9in border=off;
ods PDF file="C:\Users\YourNameHere\Documents\ElNino.PDF" nogtitle nogfootnote bookmarkgen=NO;
title1 j=l height=10pt "Report number" ;
title2 j=l height=10pt "Figure number" ;
title3 height=10pt "El Nino Southern Oscillation";
title4 height=10pt "Observation station X";
footnote1  height=10pt "footnote1: it is the space above here that I would like to reduce" ;
footnote2 j=L height=10pt "footnote 2 width=9in height=4.9in";

proc sgplot data=sashelp.enso;
    series x = month y= pressure;
    refline 10 / axis = y label = "10" lineattrs=(color=red);
run;

ods graphics off;
run;
ods _all_ close;

UPDATE: The SAS knowledge base article shared by Richard contained a useful workaround. http://support.sas.com/kb/55/923.html. Here is the adapted code:

ods graphics off;
run;
ods _all_ close;
options nodate nonumber pageno=1 pagesize=43 linesize=108 orientation=landscape papersize=LETTER LEFTMARGIN=0.87in RIGHTMARGIN=0.87in TOPMARGIN=1.25in BOTTOMMARGIN=1.25in;
ods pdf file="C:\Users\YourNameHere\Documents\ElNino2.PDF" nogfootnote nogtitle notoc;

title1 j=l height=10pt "Report number" ;
title2 j=l height=10pt "Figure number" ;
title3 height=10pt "El Nino Southern Oscillation";
title4 height=10pt "Observation station X";
footnote1  height=10pt "footnote1: The space above here is now much reduced" ;
footnote2 j=L height=10pt "footnote 2 some more details here";

/* Insert a blank row with TEXT= and eliminate the page
    break this statement generates by setting STARTPAGE=NO. */
ods pdf text=" " startpage=no;
ods graphics on / reset border=off height=4in width=7in;

proc sgplot data=sashelp.enso;
    series x = month y= pressure;
    refline 10 / axis = y label = "10" lineattrs=(color=red);
run;


/* If more pages follow, uncomment the folllowing code to   */
/* reset the STARTPAGE= option to its default value of YES. */
/*ods pdf startpage=yes;*/

ods pdf close;
ods graphics off;
run;
ods _all_ close;
1

1 Answers