Date: Thu, 6 Sep 2007 14:56:20 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject: Re: SAS missing values from Proc GPlot
Content-Type: text/plain; charset="US-ASCII"
As to the 0 values, I would set up a dummy data set with a 0 value for each
spp and site and I would concatenate this with the set that you are going
to plot. I would then sort this by spp site and plot value and use a last.
to grab the highest value. Now you should have your zeros and your real
Given that you are going to have 15*7 plots, I think that I would stick
your plot statements in a macro along the lines of
Proc Gplot data= .... (where = (speccode = &speccode)) gout =
and then stick in a %plottit for each species. Are you thinking of having 7
plots aranged one above the other or were you thinking of, say, 4 plots
across and two high. As I recall, in either case, you will need to create
your own template for either of these. Once you get the hang of doing a
template, it is not too hard to do. I would have to check but I may have
something that would work for you.
One point, if you were to go with 7 as in
I would eliminate the titles and use Proc Gslide to add that in its own box
at the top of the page. You could also do the same thing if using
1 2 4 4
4 6 7
Let me know if you need the templates.
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
"Keith W. Larson"
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
SAS missing values from Proc GPlot
Please respond to
"Keith W. Larson"
I am using SAS v8.1 and do not anticipate upgrading. I
am using Proc GPlot to create 2-way scatter plots with
lines connecting the plotted values. I have bird
capture data and I am plotting capture rates by year.
Each graph represents a single species at a single
station. There are 15 species and 7 stations.
1. How can I plot missing values as zero's. For a any
species there maybe years there were no birds
captured. Right now my graph connects two values say
1998 and 2000 with a straight line between them
implying there is a value at 1999.
2. Can I use GREPLAY to create one page for each
species with all the graphs (up to seven) for each
Below is my graph code:
**** Step 2 set graph options ****;
*** Step 2.1 setup graph output location ***;
filename grafout 'L:\Data\Analysis\Output\UK Trends
*** Step 2.2 set the title and footnote for the graph
title 'Breeding Trends, Upper Klamath Basin, 1998 to
*** Step 2.3 set graph characteristics ***;
goptions ftext=Swiss ctext=BLACK gunit=pct htitle=3.5
htext=3 cells gsfmode=replace gsfname=grafout
hsize=6in vsize=4in xpixels=3600 ypixels=2400
*** Step 4.1 define horizontal axis characteristics
axis1 width=1 offset=(3 pct) label=(a=90 r=0 "Capture
*** Step 4.2 define vertical axis characteristics
axis2 width=1 offset=(3 pct) label=("Year");
*** Step 4.3 define symbol characteristics ***;
symbol1 c=Red ci=Red v=Square i=join line=1 height=4
symbol2 c=Green ci=Green v=Triangle i=join line=1
symbol3 c=Black ci=Black v=Diamond i=join line=1
symbol4 c=Blue ci=Blue v=Circle i=join line=1
*** Step 4.4 define legend characteristics ***;
legend label=none value=(j=l 'Brood Patch Defined'
j=l 'Breeding Defined' j=l 'Breeding Resident' j=l
position=(bottom outside center) mode=reserve
****Step 3 Graph AHY Breeding Metrics ****;
proc gplot data=Work.Breeding_Trends;
by SPECCODE STATION;
plot BP_Defined * Year
Breed_Defined * Year
Breed_Resident * Year
BreedingWindow * Year / overlay legend=legend
description='Scatter Plot of AHY Breeding
Metrics * YEAR'
caxis = BLACK
ctext = BLACK
hminor = 0
vminor = 0
vaxis = axis1
haxis = axis2;
Shape Yahoo! in your own image. Join our Network Research Panel today!
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.