LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 6 Sep 2007 14:56:20 -0400
Reply-To:     Nathaniel.Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:      Re: SAS missing values from Proc GPlot
Comments: To: "Keith W. Larson" <keith_w_larson@YAHOO.COM>
In-Reply-To:  <182588.29734.qm@web51412.mail.re2.yahoo.com>
Content-Type: text/plain; charset="US-ASCII"

Keith

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 plot values.

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

%macro plotit(speccode); Proc Gplot data= .... (where = (speccode = &speccode)) gout = plots; etc

Proc Greplay quit; run; %mend plotit;

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

1 2 3 4 5 6 7

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.

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977

"Keith W. Larson" <keith_w_larson@Y AHOO.COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject SAS missing values from Proc GPlot

09/06/2007 10:57 AM

Please respond to "Keith W. Larson" <keith_w_larson@Y AHOO.COM>

Dear list,

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.

Two questions:

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 station?

Cheers, Keith

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 2007\Graphs\Non_Log\';

*** Step 2.2 set the title and footnote for the graph ***; title 'Breeding Trends, Upper Klamath Basin, 1998 to 2006'; footnote;

*** Step 2.3 set graph characteristics ***; goptions ftext=Swiss ctext=BLACK gunit=pct htitle=3.5 htext=3 cells gsfmode=replace gsfname=grafout device=jpeg hsize=6in vsize=4in xpixels=3600 ypixels=2400 rotate=landscape;

*** Step 4.1 define horizontal axis characteristics ***; axis1 width=1 offset=(3 pct) label=(a=90 r=0 "Capture Rate");

*** 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 width=2; symbol2 c=Green ci=Green v=Triangle i=join line=1 height=4 width=2; symbol3 c=Black ci=Black v=Diamond i=join line=1 height=4 width=2; symbol4 c=Blue ci=Blue v=Circle i=join line=1 height=4 width=2;

*** 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 'Breeding Window') position=(bottom outside center) mode=reserve cborder=black across=2;

****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 name='AHY_Br'

description='Scatter Plot of AHY Breeding Metrics * YEAR' caxis = BLACK

ctext = BLACK

hminor = 0

vminor = 0

vaxis = axis1

haxis = axis2;

run;

quit;

____________________________________________________________________________________

Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7

----------------------------------------- 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.


Back to: Top of message | Previous page | Main SAS-L page