Date: Tue, 19 Oct 2010 10:28:10 -0400
Reply-To: Michael Raithel <michaelraithel@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Raithel <michaelraithel@WESTAT.COM>
Subject: Re: Exporting publication quality graph
In-Reply-To: <4CBCC95D.6000300@umn.edu>
Content-Type: text/plain; charset="utf-8"
Dear SAS-L-ers,
Marc Mooney posted the following:
> Hi all,
>
> I am new to the LISTSERV. I have managed to draw a really nice figure
> using PROC GPLOT. However, when exporting my figure, I am getting
> figures that look grainy or which have annotated features displaced on
> the figure.
>
> *filename outgraph 'G:\Current Documents\1. Papers\1. In-Progress
> Projects\Dependence Regression Paper\3. Analyses\Graphs\Figure 1 Plot
> A.gif';
> *goptions gsfname=outgraph dev=gif;
>
> I tried the ODS and the figure looked fuzzy (did not resize
> dimensions).
>
> ods pdf body = "G:\Current Documents\1. Papers\1. In-Progress
> Projects\Dependence Regression Paper\3. Analyses\Graphs\pie.pdf";
> ods pdf close;
>
> Can you all please suggest some code to get my graphs out of SAS and
> looking as good as SAS drew them?
>
> Thank you,
>
> Marc
>
>
> %annomac;
> data annotate_data_ex4;
> %dclanno;
> xsys='2'; ysys='2'; hsys='2';
> **White-Out Rectangle;
> when='A';
> %bar(28,4.4,35.9,3,white,3,solid);
> **Reference Line Label;
> function='label'; color="black"; x=2.1; y=5; text='25% Reduction';
> size=.15; style='"Times New Roman"';output;
> function='label'; color="black"; x=13.8; y=5; text='50% Reduction';
> size=.15; style='"Times New Roman"';output;
> function='label'; color="black"; x=25.8; y=5; text='75% Reduction';
> size=.15; style='"Times New Roman"';output;
> proc print;
> run;
>
> goptions reset=all;
>
> *filename outgraph 'G:\Current Documents\1. Papers\1. In-Progress
> Projects\Dependence Regression Paper\3. Analyses\Graphs\HW1Fig1b.gif';
> *goptions gsfname=outgraph dev=gif;
>
> Legend1
> label = none
> value=(h = 1.5 font='Times New Roman' 'Ad Lib Smoking' 'Reduced
> Smoking'
> 'Nicotine Gum')
> across=1 down=7
> position = (top right inside)
> mode = protect;
>
> axis1 order=(1,3,6,9,12,15,18,21,24,27,30,33,36) value=(h = 1
> font='Times New Roman')
> w = 2 major =( h = 1 w = 2) minor=none label=(h = 2 f= 'Times New
> Roman' 'Time of Day');
> axis2 order=(0 to 5 by 1) value=(h = 1.5 font='Times New Roman')
> w = 2 major =(h = 1 w = 2) minor=none label=(a = 90 h = 2 f=
> 'Times New Roman' 'Event Rate');
> Symbol1 Value=dot Interpol=j l = 20 h = 1 Width = 2 Color=black;
> Symbol2 Value=circle Interpol=j l = 1 h = 1.5 Width = 1 Color=black;
> Symbol3 Value=square Interpol=j l = 4 h = 1.5 Width = 1.75
> Color=black;
> Symbol4 Value=circle Interpol=j l = 1 h = 1.5 Width = 1 Color=black;
> Symbol5 Value=square Interpol=j l = 4 h = 1.5 Width = 1.75
> Color=black;
> Symbol6 Value=circle Interpol=j l = 1 h = 1.5 Width = 1 Color=black;
> Symbol7 Value=square Interpol=j l = 4 h = 1.5 Width = 1.75
> Color=black;
>
> proc gplot data = rev.ciggum;
> where sid = 67;
>
> plot event_rate*bin_c2 = form2/ legend = legend1 anno =
> annotate_data_ex4
> href = 12
> 24
> lhref = 33 haxis=axis1 vaxis=axis2 frame ;
> format bin_c2 tbin3_.;
> run;
> quit;
>
Marc, Welcome to SAS-L! The way things usually go around here is that you star off posting questions for a while, and then one day, you realize that you can answer other posters' questions... and do... and another fine day you find yourself welcoming some new person and wondering where the time went. Speaking for the SAS-L Executive Advisory Board, we are glad to have you on-board, whatever your posting status is!
I cannot answer your SAS/GRAPH question, per se. However, your mention of the output looking grainy put me in mind of this excellent paper:
Zoom, Zoom: Get Your Document to Scale on All Paper Sizes
Daniel O‟Connor, SAS® Institute Inc., Cary, NC
http://support.sas.com/resources/papers/proceedings10/011-2010.pdf
We will be lucky enough to host Dan at this Friday's Westat SAS User Group meeting, but unfortunately, due to corporate liability issues, I cannot invite you to that meeting:-(
Getting back to the paper, it does have a section on Graphs, and does speak to writing SAS output on all types of paper sizes. So, maybe your "grainy-ness" problem can be handled by one or more of Dan's techniques. Maybe.
Marc, best of luck in all your SAS endeavors!
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael A. Raithel
"The man who wrote the book on performance"
E-mail: MichaelRaithel@westat.com
Author: Tuning SAS Applications in the MVS Environment
Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition
http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172
Author: The Complete Guide to SAS Indexes
http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
All the art of living lies in a fine mingling of letting go and holding on. - Henry Ellis
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|