Help using Base SAS procedures

How to convert my plots into pictures?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 75
Accepted Solution

How to convert my plots into pictures?

Hi everyone,

So, I have this dataset for differnet industries and different years. and I have this simple code to plot trends of industries:

proc gplot data=have;

plot var1*year;

by industry;

run;

I have 18 industries, so the output gives me 18 different graph sheets. Now, I want to write a code to take all of these to a picture. So I have added this code before running the plot:

filename output 'd:\myfile.gif';

goptions device=gif gsfname=output gsfmode=replace;

But, it gives me only one of the industries. My question is that, is there anyway to convert all of 18 graphs to 18 distinct pictures by a simple code?

I really appreciate your helps.

Thanks.


Accepted Solutions
Solution
‎11-18-2013 12:29 PM
Trusted Advisor
Posts: 2,115

Re: How to convert my plots into pictures?

Posted in reply to Shayan2012

A couple of things.

PROC GREPLAY will allow you to combine the multiple plots.

If you have SAS 9.3 or later, the ODS graphics and the SG procedures have a lot of the combination tools built in.  Check out

http://blogs.sas.com/content/graphicallyspeaking/

for some examples.

View solution in original post


All Replies
Solution
‎11-18-2013 12:29 PM
Trusted Advisor
Posts: 2,115

Re: How to convert my plots into pictures?

Posted in reply to Shayan2012

A couple of things.

PROC GREPLAY will allow you to combine the multiple plots.

If you have SAS 9.3 or later, the ODS graphics and the SG procedures have a lot of the combination tools built in.  Check out

http://blogs.sas.com/content/graphicallyspeaking/

for some examples.

SAS Super FREQ
Posts: 8,864

Re: How to convert my plots into pictures?

Hi, As Doc suggested, there are some very good examples on line. Here is a quick scatter plot that uses PROC SGPANEL to create a paneled plot. With only 3 values for CHOL_STATUS, the panel is small and "auto-arranged" but you can arrange the layout however you want (3 rows of 6 or 6 rows of 3) for your data. The doc shows how to get row-wise or column-wise panels.

Cynthia

ods _all_ close;

ods listing sge=off;

proc sgpanel data=sashelp.heart;

  panelby chol_status;

  scatter x=ageatdeath y=cholesterol;

run;

Super User
Posts: 11,343

Re: How to convert my plots into pictures?

Posted in reply to Shayan2012

I suspect if you are generating HTML output and pay attention to which folder that output goes to, you will find a plethora of PNG files (basically GIF equivalents) all sequentially numbered named gplot.png, gplot2.png, ...

If that location happens to be the temporary work library location don't expect them to survive as SAS shut down, but directing the HTML output to a specific location should let you control where to find them.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 235 views
  • 6 likes
  • 4 in conversation