I am plotting a couple of line plots using proc gplot. I am rotating the graphs to a landscape orientation and outputting to pdf. My problem is that the graphs take up too much real estate and the title gets hidden. I tried playing around with some of the hsize, horigin, etc. kinds of options to no avail. Does anyone have any ideas? Here is the code:
ods listing close;
ods html close;
ods pdf file='c:\PlotBRet.pdf' columns=2;
Rather than rotate with GOPTIONS, I rotated the PDF output and then with columns=2, had enough real estate to get the two plots side-by-side using SASHELP.PRDSALE. (With only 2 numeric variables, I took out the OVERLAY option.)
ods _all_ close;
topmargin=.5in bottommargin=.5in leftmargin=.5in rightmargin=.5in;
ods pdf file='c:\temp\PlotBRet.pdf' columns=2;
Thanks Cynthia. I knew I had tried something like this, but couldn't recall the result. I tried it again and I get an Error: Device Not Specified message in the log. It seems to be related to the "reset=all" in GOPTIONS statement, because I can remove that and it runs (but I'm back to my original problem of the title being hidden at that point). Any thoughts as to why that would occur.
You can fix the device issue by using an explicit DEVICE= specification after the RESET=ALL (or I believe it might also work if you moved the GOPTIONS statement BEFORE the ODS PDF statement):
goptions reset=all device=sasprtc htitle=1;
However, I ran my code in SAS 9.2, Phase 2 release and did not get an ERROR message or warning in the LOG:
4326 ods _all_ close;
4328 %put &sysvlong;
4330 options orientation=landscape topmargin=.5in
4330! bottommargin=.5in leftmargin=.5in rightmargin=.5in;
4331 ods pdf file='c:\temp\PlotBRet2.pdf' columns=2;
NOTE: Writing ODS PDF output to DISK destination
"c:\temp\PlotBRet2.pdf", printer "PDF".
4333 GOPTIONS reset=all htitle=1;
4335 /* symbols defs skipped for pasting */
4337 Legend1 FRAME;
4338 Axis1 STYLE=1 WIDTH=1 MINOR=NONE;
4339 Axis2 STYLE=1 WIDTH=1 MINOR=NONE;
4340 Axis3 STYLE=1 WIDTH=1 MINOR=NONE;
4343 TITLE1 "Barra Factor Returns as of %SYSFUNC(DATE(),
4347 ods proclabel 'BF Returns';
NOTE: There were 24 observations read from the data set
WHERE (year=1994) and (region='EAST') and
(country='CANADA') and (product='DESK');
NOTE: PROCEDURE GPLOT used (Total process time):
real time 3:17.76
cpu time 1.76 seconds
4349 PROC GPLOT DATA = sashelp.prdsale NOCACHE ;
4350 where year = 1994 and region='EAST' and country='CANADA'
4350! and product='DESK';
4351 PLOT (actual)*Month / NOFRAME VZERO VAXIS=AXIS1 VREF=0
4351! HAXIS=AXIS2 SKIPMISS LEGEND=LEGEND1;
4352 PLOT (predict)*Month / NOFRAME VZERO VAXIS=AXIS1 VREF=0
4352! HAXIS=AXIS3 SKIPMISS LEGEND=LEGEND1;
4356 ods pdf close;
NOTE: ODS PDF printed 1 page to c:\temp\PlotBRet2.pdf.
4358 ods listing;
4359 TITLE; FOOTNOTE;
4360 GOPTIONS RESET=ALL;
This leads me to wonder 1) what version of SAS you're using and 2) what operating system you're using and 3) in what other context you might be submitting the code (such as from within SAS Enterprise Guide or as a SAS Stored Process).
However, at this point I have no idea why your title is being obscured. Without knowing the units that are set for your SAS/GRAPH goptions, it is hard to know what HTITLE=1 means -- the UNITS for HTITLE could be in CELLS, CM, IN, PCT or PT -- so a few things you could try are 1) to specify an explicit unit for size for the HTITLE= option:
and see whether the title is still obscure;
or 2) take HTITLE out altogether and allow the style template (if you are using SAS 9.2) to control the titles and see whether the title is still obscure; or
or 3) take HTITLE out altogether and alter the TITLE statement:
TITLE1 h=2pct "Barra Factor Returns as of %SYSFUNC(DATE(), EURDFDE9.)";
TITLE1 h=14pt "Barra Factor Returns as of %SYSFUNC(DATE(), EURDFDE9.)";
At this point, your best bet for help might be to open a track with Tech Support. They can help you with solutions that will be specific to your version of SAS and your operating system. To open a track with Tech Support, fill out the form at this link: http://support.sas.com/ctx/supportform/createForm
OK, thanks Cynthia. That more or less did it. Just for reference, I'm using Enterprise Guide and currently running the program locally rather than on our server. It's a Windows platform and the SAS version is 9.1.3 SP4.
This last iteration fixed the title, but then added Titles on each plot and also messed up the legend and x-axis in terms of the font. I'm assuming I can fix that though.