BookmarkSubscribeRSS Feed
Calcite | Level 5

I am producing an RTF file using proc template and sgrender from a program I inherited and admittedly don't know a lot about either.  The issue that I'm running into though has less to do with either of those (I think) and more to do with the amount of space SAS is "preserving" for the figure.  In the RTF file, there is about an inch of white space beneath the legend and I can't figure out how (or if) I can reduce that amount of white space.  I've tried increasing the size of the plot, but then it crashes into my footnotes.  So just curious if anyone knows of a way that I can tell SAS not to preserve so much white space at the bottom of the page.  I did also try reducing the bottom margin size in the template (as seen in the code below), but that didn't seem to have the desired effect.  Any help is appreciated!



** set up template *;
proc template;
  define style plot1style;
  parent=styles.tlfrtf ;

  replace body / bottommargin =.1in;
  %do _x=1 %to &trtcnt;
  class GraphData&_x / contrastcolor=black color=&&&c&_x.color linestyle=1 markersymbol="&&&c&_x.symbol";

  define statgraph ptemplate1;
  dynamic _byval2_;
  layout lattice / rows=2 columns=1 rowweights=(0.9 0.1) columndatarange=union;
  layout overlay / xaxisopts=(display=(label ticks tickvalues) label='Visit (Week)' tickvalueattrs=(size=9pt)
  linearopts=(tickvaluelist=(%str(&incrm)) viewmin=&minvis viewmax=&maxvis) labelattrs=(family="Albany AMT" size=9pt))
  yaxisopts=(griddisplay=on label=_byval2_ labelattrs=(family="Albany AMT" size=9pt) linearopts=(THRESHOLDMIN=1 THRESHOLDMAX=1));

  boxplot x=nomnum y=aval / group=&trtval boxwidth=1 groupdisplay=cluster clusterwidth=.5
  name='c1' capshape=line extreme=false SPREAD=true meanattrs=(symbol=diamond color=yellow size=5) OUTLIERATTRS=(symbol=asterisk /*color=black*/ size=5);
  discretelegend 'c1' / valueattrs=GRAPHVALUETEXT(Weight=Bold family="Albany AMT" SIZE=9pt);




.....some macro code......


ods graphics / width=9.8in height=5.5in imagename="&imagnme" border=off;
ods listing gpath="&_sasws_&_outpath";
ods rtf file="&_sasws_&_outpath./&filename..rtf" style=plot1style;


proc sgrender data=out.&outdat template=ptemplate1;
    by paramcd param;

ods graphics off;
ods rtf close;
ods listing;





Super User

You have a number of things that may be affecting this. The parent style Tlfrtf may have other things you need to look at.

You would likely have to share the definition of that style for use to see.


Did you try the appearance with the default RTF style and see if that changes anything?


I am a bit surprised that you have a footnote appearing outside of the graph at all. There is nothing in that code that should create a footnote.


Have you experimented with the ODS RTF options of Gfootnote / nogfootnote and Gtitle/nogtitle? They interact with SAS title and footnote statements.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation