Date: Mon, 27 Oct 2008 10:40:41 -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 Graph GPLOT 2 questions.
In-Reply-To: <BMadnbC9CK4YHZ_UnZ2dnUVZ_ofinZ2d@giganews.com>
Content-Type: text/plain; charset="US-ASCII"
On your plot statement, add
Plot .... / vref = 100
to put a horizontal line at 100.
You can get vertical lines either by using href= where you specify a
list or you may be able to the the autohref = statement. However, these
will run the full height of the Vaxis. To get lines from the haxis to the
plot line, you could
1) use annotate draw statements
or
2) generate a set of dummy lines with a pair of points whose x value is
for the particular tick value. One y value would be 0 and the other the
value of the plotted Y for that x value.
Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Red Eagle
<rdb1956@HOTMAIL.
COM> To
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
Discussion" cc
<SAS-L@LISTSERV.U
GA.EDU> Subject
SAS Graph GPLOT 2 questions.
10/24/2008 10:12
PM
Please respond to
Red Eagle
<rdb1956@HOTMAIL.
COM>
GPLOT Questions as follows.
First question
How do I get one horizontal line running across a line graph at some known
value on the Vertical scale? For example the known value is 100 and the
graphed
data line moves around this line like a snake on a branch. Probably not
important to the answer but the horizontal scale is monthly data through
several years.
I am certain there is more than one way to do this. Simplest would be best.
Second question.
On this same graph where the horizontal scale is made up of monthly data
over
several years, there needs to be vertical lines from the data line on the
graph
to the horizontal axis at every year change over. There is one data point
for
each month.
It is also acceptable to run the year change-over lines top to bottom on
the
graph. If possible what is the easiest or best way to do this?
The intention is to remove the horizontal axis and only show a label for
each
year centered between the vertical lines marking the year change over.
I tried a few methods which didn't work.
data mydata;
filename indexdata 'data.txt';
infile indexdata stopover end=done;
input @1 Ref_Period $6. /* YYYYMM */
@1 Year 4.
@5 Month 2.
@9 Indx 5.
@17 Indx_chg_annual 4.
@25 Indx_chg_monthly 4.;
data_date = MDY(Month,15,Year);
if _n_ = 1 then call symput('startdate',data_date);
if done then call symput('enddate',data_date);
run;
symbol1 color=blue value=dot height=1 interpol=join;
axis1 label=none major=none minor=none style=0 value=none;
axis2 label=none major=(height=3 width=2) minor=none style=0 width=3
order=(&startdate to &enddate by month);
proc gplot data=indexdata;
plot indx*data_date / autohref vaxis=axis1 haxis=axis2; /* using a
sas
date */ run;
quit;
Data sample ....
200809 107.2 3.3 4.4
200808 102.7 -1.8 -1.7
200807 104.5 1.6 -2.2
200806 106.8 2.6 -0.4
200805 107.2 4.6 3.0
. . .
Thanks in advance!!!!
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.