Date: Mon, 20 Nov 2006 15:34:39 -0600
Reply-To: Yu Zhang <zhangyu05@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yu Zhang <zhangyu05@GMAIL.COM>
Subject: Re: Legend in proc gplot?
In-Reply-To: <445d9dbe0611201311i2e14b846u7f3b5b7a0b157b61@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I created a annotation sample for your problem. the position for the lengend
is hard coded. you can put wherever you like to place it as long as it is in
the graphic output area.
HTH
Yu
data graph;
do i = 1 to 100;
x = rannor(34534);
y = rannor(456);
z = rannor(5675);
output;
end;
run;
data anno;
length text $10. function $15. color $15.;
retain xsys '2' ysys '2' when 'a';
x=45;y=-2; function='label'; text='plot';output;
x=49;y=-2;function='move';output;
x=58;y=-2;function='draw';line=1;position='9';color='black';output;
position=' ';
x=62;y=-2;function='label';text='line1';output;
/*line for lengend 2*/
x=49;y=-2.2;function='move';output;
x=58;y=-2.2;function='draw';line=3;position='9';color='red';output;
position=' ';
x=62;y=-2.2;function='label';text='line2';output;
run;
goptions reset=all;
symbol1 i = spline l=1 c =black;
symbol2 i =spline l =3 c = blue;
symbol3 i=spline l =3 c = red;
proc gplot data = graph;
plot z*i y*i x*i/overlay anno=anno nolegend ;
run;
On 11/20/06, Yu Zhang <zhangyu05@gmail.com> wrote:
>
> Amy Sun,
>
> As far as I know, there is no such option can supress the display of the
> symbol. However, you can define your own legend using annotation datasets
> with option 'nolegend'.
>
> If I am wrong on this, someone on the list please correct me.
>
>
> HTH
>
> Yu
>
> On 11/20/06, Amy Sun <tonyliang20032@gmail.com> wrote:
> >
> > Hi, ALL;
> >
> >
> > I want to make a graph using the following sample code:
> >
> >
> > *data* graph;
> >
> > do i = *1* to *100*;
> >
> > x = rannor(*34534*);
> >
> > y = rannor(*456*);
> >
> > z = rannor(*5675*);
> >
> > output;
> >
> > end;
> >
> > *run*;
> >
> >
> >
> > symbol1 i = spline l=*1* c = red;
> >
> > symbol2 i =spline l =*3* c = blue;
> >
> >
> >
> > legend1 across = *1* value = (tick = *1* justify = left " line1"
> >
> > tick = *2* justify = left "line2")
> >
> > order = (*1*, *2*) position = (Middle center inside);
> >
> >
> >
> > *proc* *gplot* data = graph;
> >
> > plot z*i y*i x*i/overlay legend = legend1;
> >
> > *run*;
> >
> >
> >
> > There should have 3 symbol in the graph legend, while I only want 2, and
> > I
> > tried the option order in the legend1 statement, it does not work and
> > SAS
> > gives me the following error message
> >
> > ERROR: The ORDER= entry "1.00" is not a legend value.
> >
> >
> >
> > BTW, the option order does work in the proc gchart when using pattern
> > statement.
> >
> >
> >
> > Then, how can I do next?
> >
> >
> >
> > Thank in advance for your help.
> >
> >
> >
> > Best,
> >
> > Tony
> >
>
>
|