BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm a bit confuse on how to modify the name of a graphics image file.

It seems like the only thing to do is to enable the IMAGENAME= option in the ods graphics statement, but it doesn't work well for me..
(ref: http://support.sas.com/rnd/app/da/stat/odsgraph/faq.html)

Would that be the problem that I use ODS HTML at the same time?

The following is my code:
ods html path = "C:\QA2"
gpath = "C:\QA2\gif" (url="gif/")
file = "test.htm";

ods graphics on / imagename = "MyName"
imagefmt = png;

proc gplot;
...
plot statement;
...
quit;

ods graphics off;
ods html close;



With this code, I was able to save the output in HTML format in C:\QA2 as well as graphics file (named gplot.png) in C:\QA2\gif. I was hoping the IMAGENAME option would change the name to MyName.png and save it at C:\QA2\gif. Am I missing something?

Thanks!!
5 REPLIES 5
David_SAS
SAS Employee
PROC GPLOT is not a statistical graphics procedure, and thus doesn't honor the ODS GRAPHICS statement. With SAS 9.2, the new PROC SGPLOT is production. It does honor the ODS GRAPHICS statement. (In fact, you don't even have to specify ODS GRAPHICS if you're happy with its defaults.)

You can learn about PROC SGPLOT here:

http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/sgplot-chap.htm

-- David Kelley, SAS
Cynthia_sas
SAS Super FREQ
And, for regular SAS/Graph procedures, most procedures support the NAME= option which would be the name that is used by SAS/Graph to assign a name to your file (other than GPLOT1, GPLOT2, etc)

If you look in the SAS/Graph documentation for your procedure of choice, you can see how and where the NAME= option goes.

cynthia
deleted_user
Not applicable
Thanks for the suggestions. I see both methods are useful, i enjoy exploring different ways to meet the same goal.

Also, when I tried to customized the plot, it seems like PROC GPLOT can be a better tool if the graph is fairly straight forward with fewer items to customized. Because we can simply specify the AXIS statement in order to modify the axis label, position, angle, major and minor ticks and etc. But if for PROC SGPLOT, we need to do it by changing the default template in PROC TEMPLATE.
Cynthia_sas
SAS Super FREQ
Hi:
Actually, if you look at the documentation, you will see that SGPLOT, in particular has several AXIS statements that you can use without venturing into Graph Templates.
cynthia
http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/xaxis-stmt.htm
deleted_user
Not applicable
That's very good tips. I must have missed that part.

Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 646 views
  • 0 likes
  • 3 in conversation