Date: Tue, 15 Aug 2006 09:56:36 -0400
Reply-To: "Bross, Dean S" <dean.bross@VA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Bross, Dean S" <dean.bross@VA.GOV>
Subject: Re: Overlaying multiple histograms on single graph?
In-Reply-To: <200608150204.k7EKs7E7019637@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
I have never done this myself, but I did a little digging into
the SAS documentation and it appears that you might have to use
PROC FONTREG in order to make the GIF driver recognize this font.
They actually include an example of modifying the GIF driver to use
another freetype font:
This information was copied from the documentation. I'm using version
9.1
Modifying SAS/GRAPH Device Drivers to Use System Fonts
To access FreeType fonts with the SAS/GRAPH device drivers, the CHARREC
field
of the device driver entry must be modified from its default value of
DMS Font
to any FreeType font.
Here is an example that shows how to modify the CHARREC field:
/* Assign a location for the personal devices catalog */
libname gdevice0 '.';
/* Create a new GIF device driver, FTGIF, */
/* that will recognize FreeType fonts */
proc gdevice nofs c=gdevice0.devices;
copy GIF from=sashelp.devices newname=FTGIF;
mod FTGIF charrec=(0, 1, 1, '<ttf> SAS Monospace', 'Y');
end;
The following device drivers can be modified to recognize FreeType
fonts:
GIF, GIF733, GIFANIM
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of Pete
Sent: Monday, August 14, 2006 10:04 PM
To: SAS-L@LISTSERV.UGA.EDU
Cc: Pete
Subject: Overlaying multiple histograms on single graph?
Hi Pholks.
I have two questions related to SAS this evening:
1. How do I get SAS/Graph to recognize and generate Times New Roman
font? When I write to a *.GIF file, SAS can't find this font and
defaults
to SIMPLEX. This is annoying. I know there is some procedure buried
somewhere out there that can help me read in Times to the font list, but
I'm not sure where. Any ideas?
2. I am running PROC UNIVARIATE to calculate and graph some histograms.
Each outputted page (i.e. GIF file) currently has two histograms on top
of
each other: One for the year 2030 and one for 2080 (stacked via the
CLASS
statement).
However, within each year, I would like to overlay a few more histograms
(or fitted normal lines in this case).
In short, I would like to have three fitted normal curves overlaid on
both
the top and bottom graph in my output (representing COOL, MID, and HOT).
Is there a way this can be done with UNIVARIATE or can this be done with
the COMPHIST procedure? Code examples would be great. Many thanks in
advance for your help.
Pete in Alaska
-----
%macro tmploop (var1,var2,var3,var4);
data loop1;
set final.climate_postMC;
if GCM_Region = "&var1." and Season="&var2." and Measure="TEMP"
then output loop1;
run;
data loop1;
set loop1;
informat AVG_1980to1999 4.1;
format AVG_1980to1999 4.1;
if _n_ = 1 then do;
call symput('mu',put(compress(trim(AVG_1980to1999)),4.1));
end;
run;
%put &mu.;
filename gifgraph "P:\P H Larsen\NCEP\Model\SAS\Output\&var4..gif";
goptions device=GIF gsfname=gifgraph gsfmode=replace;
options orientation=landscape;
proc univariate noprint data = loop1 noprint;
var &var3._Draw;
class Forecast_Year;
title1 "Probability of &&var1.'s &var2. Climate";
%if &var3.=COOL %then %do;
title2 "Wet Model (Australia)";
%end;
%if &var3.=MID %then %do;
title2 "Middle Model (US-NOAA)";
%end;
%if &var3.=HOT %then %do;
title2 "Dry Model (Japan)";
%end;
histogram &var3._Draw /nobars nrows=2 ncols=1 font='Times New
Roman' height=2 normal midpoints=0 to 50 by 5 href=&mu.
hreflabel="Basecase:&&mu.(F)" HREFLABPOS=3 /*cframe=white*/ cv=black;
inset mean='Projected Average:' (4.1) /pos=ne;
label Forecast_Year = "Projected Year";
%if &var3.=COOL %then %do;
label &var3._DRAW = "Degrees (F)";
%end;
%if &var3.=MID %then %do;
label &var3._DRAW = "Degrees (F)";
%end;
%if &var3.=HOT %then %do;
label &var3._DRAW = "Degrees (F)";
%end;
run;
%mend;
%tmploop (ANCHORAGE,ANNUAL,COOL,ANC_ANN_WET_TEMP); ***Cool loop;
%tmploop (ANCHORAGE,ANNUAL,MID,ANC_ANN_MID_TEMP); ****Mid loop;
%tmploop (ANCHORAGE,ANNUAL,HOT,ANC_ANN_DRY_TEMP); ****Hot loop;