BookmarkSubscribeRSS Feed
DYL
Fluorite | Level 6 DYL
Fluorite | Level 6

Hi,

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).  

Thanks

4 REPLIES 4
ballardw
Super User

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.

 

DYL
Fluorite | Level 6 DYL
Fluorite | Level 6
In this case I think the easiest thing to do is to post-process the image as Vince suggested below. But for future projects (with less time constraints) I will definitely look into the GTL option. Thanks for the suggestion
Vince_SAS
Rhodochrosite | Level 12

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:

 

https://image.online-convert.com/convert-to-eps

 

Vince DelGobbo

SAS R&D

DYL
Fluorite | Level 6 DYL
Fluorite | Level 6
Thanks, Vince. That is probably the easiest thing to do in this case since it does not have to be automated.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 4 replies
  • 2386 views
  • 4 likes
  • 3 in conversation