Date: Mon, 27 Oct 2008 10:40:41 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject: Re: SAS Graph GPLOT 2 questions.
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
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.
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
SAS Graph GPLOT 2 questions.
Please respond to
GPLOT Questions as follows.
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
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
I am certain there is more than one way to do this. Simplest would be best.
On this same graph where the horizontal scale is made up of monthly data
several years, there needs to be vertical lines from the data line on the
to the horizontal axis at every year change over. There is one data point
It is also acceptable to run the year change-over lines top to bottom on
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
year centered between the vertical lines marking the year change over.
I tried a few methods which didn't work.
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);
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
date */ run;
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.