|
Matt
It looks like you want to draw horizontal and vertical lines from the axes
to some specific point. Some years ago, I wanted to plot water temperatures
in a river and superimpose horizontal lines that indicated such information
as the range of spawning temperatures. Hence, you would see the plot of the
temperatures starting in winter and continuing for some appropriate number
of months. A horizontal band was overlaid that intersected the curve at some
point. Unfortunately, I have not been able to find a sample plot but I do
have the code that built the annotate data set.
/* create an annotate data set that will draw the lines */
data anno; * draw low and high spawning temp lines - the length will be the
period;
set plot;
sp=&fish;
if species=:sp; ;
call symput('spp',sp);
length function color $8;
retain function when 'a' xsys '2' ysys '2' color 'black';
* first, fix the low value;
y=JandB_low;
x=start;
function='move';
output;* move pointer to start of line;
function='draw';
size=3;
x=stop;* this is the end of the line;
output;
* now, do the upper line;
x=start;
y=JandB_high;
function='move';
output;* move the pointer to the start of the line;
function='draw';
x=stop;
output;
run;
This may be a useful example. At another time, I did a similar project that
drew filled bands that showed such information as spawning temperatures and
lethal temperatures. I'm pretty sure that I still have the code but it would
take me a little while to find it and I fear that I have to go do chores
now.
Please let me know if you need me to look for that program. I think that I
still have a hardcopy of the graph and I could scan it and send it to you
off line.
Nat Wooding
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Matthew
Pettis
Sent: Tuesday, March 01, 2011 10:35 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: PROC GPLOT and Annotate: Examples of shaded vertical regions
Hi,
Working through annotations in SAS GRAPH GPLOT... I was wondering if
anybody knows of a specific example I could use as a template. What I
have is a graph with time on the X-axis and a count on the Y-axis. What
I want to do is make shaded and transparent rectangles in the chart that
go from the x-axis to the top and left and right boundaries at different
times. That will highlight the graph for a timerange/timeranges that I
want to call attention to. I'll be working through the documentation on
the annotation dataset concept, but if anyone has a shortcut solution to
this, I'd much appreciate hearing about it.
Thanks,
Matt
|