Data visualization with SAS programming

Proc Gmap and high quality output graphics

Accepted Solution Solved
Reply
Super Contributor
Posts: 333
Accepted Solution

Proc Gmap and high quality output graphics

I feel like this should be an easy thing to do, especially for the length of time that I have been using SAS, but I am at a lost going through the documentation. It may be more a matter of me have very little understanding when it comes to graphic files and the like.

I created a map that I need to output to a graphic file, preferably at 300 dpi and 500 x 500 pixels using a PNG or other high resolution graphic file, with the outcome being a image file of the graphic that appears in SAS. Can someone outline the syntax steps that are needed to accomplish this? These go through our communications department and it doesnt seem to matter how we do it we dont get the high resolution file.

Thanks for any help that can be provided!

EJ


Accepted Solutions
Solution
‎05-06-2014 07:55 AM
Super Contributor
Posts: 273

Re: Proc Gmap and high quality output graphics

E J

I am not familiar with EG but

what happens if you place before your gplot code

ods listing  gpath="some directory";

But i doubt as you graph is normally going to a sas catalog

and not a separated file

Andre

Discard this as you were sending your code at the same time

i was answering

View solution in original post


All Replies
SAS Super FREQ
Posts: 925

Re: Proc Gmap and high quality output graphics

Use the PNG300 device instead of the PNG device and see if that gives you what you want. Let me know if it doesn't. Thanks!

Super Contributor
Posts: 333

Re: Proc Gmap and high quality output graphics

I noticed that device and will try that for the high resolution piece. The real problem is assigning where the file is stored. We have used a filename statement with a goption option (which I can off hand remember) to assign the name and path, but it never seems to be created. The only graphic file we found was in our temp directory. But I just remembered that this was being ran also under EG which may have complicated things as well with its default ODS settings and auto generated code.

EJ

Super User
Posts: 11,134

Re: Proc Gmap and high quality output graphics

I would try an explicit ODS destination for the output.

Super Contributor
Posts: 333

Re: Proc Gmap and high quality output graphics

Maybe Im not following ... I need the actual image file and not a pdf / rtf / html etc...

Can you be more specific?

Thanks

EJ

Solution
‎05-06-2014 07:55 AM
Super Contributor
Posts: 273

Re: Proc Gmap and high quality output graphics

E J

I am not familiar with EG but

what happens if you place before your gplot code

ods listing  gpath="some directory";

But i doubt as you graph is normally going to a sas catalog

and not a separated file

Andre

Discard this as you were sending your code at the same time

i was answering

Super Contributor
Posts: 333

Re: Proc Gmap and high quality output graphics

This worked Andre ...and this may be what was getting at in his post.

One of the mysteries of ODS syntax.

I think I need a course "How to be a graphic designer when all you want to be is a SAS Programmer". Maybe RobertAllison@SAS and Sanjay@SAS

can develop that Smiley Happy

EJ

Super Contributor
Posts: 273

Re: Proc Gmap and high quality output graphics

E J

i was guessing and infering !

OR you were in a Eg context OR you were on an implicit open destination which in 9.32 is : ods html.

To catch the file in another place   use the gpath=  that was thus  working

For your other ask, my counsel is to read and study  this

http://www.epi.soph.uab.edu/bugs/zender/Super_Demo_ODS_Graphics.pdf

as ods is part of the every day life with SAS.

Already at the beginning is gpath appearing...

Best

Andre

Super User
Posts: 11,134

Re: Proc Gmap and high quality output graphics

My suggestion about explicit ODS output was mostly aimed at HTML because then the images, png files, referenced in the html are placed in the same folder (path).

Super Contributor
Posts: 333

Re: Proc Gmap and high quality output graphics

I got back to my code so I can show it now. Still having the problem that the image is not in the location specified.

%_sas_pushchartsize(500, 500);

GOPTIONS CBACK= ;

PATTERN1 VALUE=SOLID COLOR=CXEFF3FF;

PATTERN2 VALUE=SOLID COLOR=CXBDD7E7;

PATTERN3 VALUE=SOLID COLOR=CX6BAED6;

PATTERN4 VALUE=SOLID COLOR=CX2171B5;

LEGEND1

DOWN=2

FRAME

POSITION=(BOTTOM CENTER OUTSIDE)

LABEL=( FONT='Arial /b' HEIGHT=10pt JUSTIFY=LEFT   "County Percentage")

;

TITLE;FOOTNOTE;

TITLE1 "Percent of County Medicare Population that are Dually Eligible";

FOOTNOTE1 " ";

filename out "h:\SCDE.png";

goptions dev=png300 gsfname=out gsfmode=replace;

PROC GMAP GOUT=MAPCHART DATA=WORK.MAPCHARTRESPONSEPREP MAP=WORK.MAPCHARTMAPPREP ALL ;

ID COUNTY;

CHORO perc /

WOUTLINE=1

LEVELS=4

STATISTIC=FIRST

LEGEND=LEGEND1

;

RUN;

QUIT;

TITLE;FOOTNOTE;

GOPTIONS RESET=LEGEND;

GOPTIONS RESET=PATTERN;

GOPTIONS CBACK=;

🔒 This topic is solved and locked.

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

Discussion stats
  • 9 replies
  • 998 views
  • 3 likes
  • 4 in conversation