07-13-2018 03:15 PM
I have created a composite figure for a publication using ods layout. The figure is composed of 4 separate plots generated with 4 proc sgpanel statements and one legend generated using a proc template and sgrender procedure. I originally output it as a PDF using an ods pdf statement.
ods listing gpath = "&path.\Images" image_dpi=300; ods pdf file = "&Out.\Images\Fig1.pdf" notoc; ods layout start width=8.3in height=7.05in;
* top left pane; ods region width=4in height=3in x=.1in y=.1in; proc sgpanel data = one noautolegend sganno=annoA; <code omitted > run; *top right pane; ods region width=4in height=3in x=4.2in y=.1in; proc sgpanel data = two noautolegend sganno=annoB; <code omitted > run;
*bottom left pane; ods region width=4in height=3in x=.1in y=3.2in; proc sgpanel data = three noautolegend sganno=annoc; <code omitted > run;
*bottom right pane; ods region width=4in height=3in x=4.2in y=3.2in; proc sgpanel data = four noautolegend sganno=annod; <code omitted > run; * footer; ods region height=0.75in x=.1in y=6.25in; ods graphics / reset noscale noborder maxlegendarea=100 width=4 in height=0.75in; proc sgrender data = sashelp.class template=legendonly; run; ods graphics/reset=all; ods layout end; ods pdf close;
However, the journal requires either a EPS or TIFF file to be submitted. If I change the imagefmt in the ods graphics statement I can get the 5 separate epsi or tiff image files that comprise the components of the composite figure, but I don't know how to get the complete figure that results from the ods layout statement to come out in a different file format.
Is there a way to use ods layout with anything other than ods pdf or ods powerpoint? Alternatively, would adding a .eps filename extension to the the ods pdf statement (e.g. ods pdf file = "Fig1.eps") generate an EPS file?
I am using SAS 9.4 (TS1M3).
07-13-2018 03:56 PM
If this were my project I would be tempted to create the image files and then embed them.
The ODS Graphics statement uses the option OUTPUTFMT to set the graphic output file format. You can create EPS with either ODS LIsting or ODS Printer output. Use the IMAGENAME="filename" option on ODS Graphics to set the file name. You may want to check with the documentation about supported image types and destinations as incompatible options sometimes take a while to trace down why my image doesn't work or you get PNG instead of TIFF. Use fully qualified filepath with the name to be sure you can find the output image file.
If you want a single image file with 4 graphs I suspect you might want to delve into GTL as it has layout options to do grids of graphs.
a month ago
07-13-2018 06:32 PM
Must the process be automated? If not, then perhaps you can post-process the PDF file using a tool like this to create the EPS file: