Data visualization with SAS programming

Saving Graph as PNG

Reply
Regular Contributor
Regular Contributor
Posts: 166

Saving Graph as PNG

Guys i was trying to save my graph output to a specified path.
I wanted the output to be a .png file.

I tried using the below code but the PNG file gets created in the work library and not in the defined my_folder path.

Any suggestions... would be helpful

Thanks

filename graphout "/my_folder/";
goptions reset=all device=png gsfname=graphout;
PROC GPLOT DATA = sashelp.class;
PLOT Age * Name / name="mychart2"
VAXIS=AXIS1

HAXIS=AXIS2

FRAME;
RUN; QUIT;
Super Contributor
Posts: 273

Re: Saving Graph as PNG

A filename is a filename and not a directory only

on windows it works with by example with

filename graphout "d:\temp\name.png";

the -- name.png -- is the name of the file and is located where you/i indicate it
even if you have in your work.gseg an object grseg with Mychart2 name
after a first try!

Andre
Post a Question
Discussion Stats
  • 1 reply
  • 115 views
  • 0 likes
  • 2 in conversation