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