Date: Fri, 29 May 2009 08:59:21 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: gplot
Content-Type: text/plain;charset=iso-8859-1
hi ...
#1 for this part ... "How do I put the values from pointlabel on top of the circles (Iwould like to keep
style='psolid' rather than style='pempty')? The values from pointlabel are currently being masked by the circles
it looks as if you are adding your own solid circles with annotate
in the annotate data seet you have when = 'a' ... so, annotate adds solid
circles after GPLOT places the point labels ... try when = 'b' so
annotate adds the solid circles first, then GPLOT will write the labels on top
or ... why not just label the points with annotate since you are already adding the circles with
annotate ...
data annobub;
set test;
length function color $8;
retain xsys ysys hsys '2' when 'a';
x=lvlord;
y=rate;
function='pie';
rotate=360;
if series eq 1 then color='CXD9576E';
if series eq 2 then color='CXE5B82E';
size=avg/6;
position='4';
style='psolid';
output;
function='label';
cbox='white';
size=2;
text=cat(rate);
output;
run;
and not via the SYMBOL statement
also ... in GPLOT, you have ...
plot rate*lvlord=series /
and ...
plot2 rate * lvlord /
the PLOT does two plots ... one for each series in different colors that you then cover with circles
from the annotate data set
the PLOT2 adds the same point, but this time in one color
so ...why the PLOT2 or am I missing something? just curious
******************************************
#2 as for this part ... "only some of my values for lvlord are showing on the x-axis. How do I get
all of the values for lvlord to show on the x-axis? LVL10 is a character variable which is
a list of locations (eg LA, Fresno, etc)."
as Gerhard said, the order controls the points
but, why not just use the character variable in GPLOT rather than a proxy (_n_) plus a format
take a look at the following ... the PLOT statement uses a character variable
(you have to use XC not X in the annotate data set to position the circles and labels)
* your annotate data step with point labels added;
data annobub;
length function color $8;
retain xsys ysys '2' hsys '3' when 'a';
set sashelp.class (rename=(name=xc height=y));
function='pie';
rotate=360;
select (sex);
when ('M') color='CXD9576E';
when ('F') color='CXE5B82E';
end;
size = y / 30;
position='5';
style='psolid';
output;
function='label';
color='blue';
cbox='white';
size=1;
text=cat(y);
output;
run;
goptions reset=all ftext='calibri' htext=2 ctext=blue gunit=pct;
axis1 offset=(5,5)pct;
* character variable NAME used in PLOT statement;
proc gplot data=sashelp.class annotate=annobub;
plot height*name=sex / haxis=axis1 noframe nolegend;
format name $3.;
run;
quit;
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> not too firm in graphics, but for the dots versus circles:
>
> symbol v=dot w=1 h=5 c=blue;
>
> if you want to have influence on what you see on the x-axis, you must
> decide that with the axis-statement:
>
>
> axis2 offset=(3,3) value=(f=swissb h=1) label=none order=(40 to 100 by 20);
>
> Gerhard
>
>
>
>
>
> On Thu, 28 May 2009 16:43:55 -0700, J M <jasonm@UCLA.EDU> wrote:
>
>>I have two questions regarding gplot.
>>1) How do I put the values from pointlabel on top of the circles (I
>>would like to keep style='psolid' rather than style='pempty')?
>>The values from pointlabel are currently being masked by the circles.
>>2) Only some of my values for lvlord are showing on the x-axis. How do
>>I get all of the values for lvlord to show on the x-axis?
>>LVL10 is a character variable which is a list of locations (eg LA,
>>Fresno, etc).
>>lvlord is equal to _n_.
>>
>>data stname;
>>set test (rename=(lvlord=start LVL10=label));
>>fmtname='dataord';
>>type='N';
>>keep fmtname label start type;
>>run;
>>proc format cntlin=stname;
>>data annobub;
>>set test;
>>length function color $8;
>>retain xsys ysys hsys '2' when 'a';
>>x=lvlord;
>>y=rate;
>>function='pie';
>>rotate=360;
>>if series eq 1 then color='CXD9576E';
>>if series eq 2 then color='CXE5B82E';
>>size=avg/6;
>>position='4';
>>style='psolid';
>>output;
>>run;
>>
>>GOPTIONS reset=all rotate=landscape device=ACTIVEX;
>>axis1 offset=(0,0) value=(f=swissb) label=none;
>>axis2 offset=(3,3) value=(f=swissb h=1) label=none;
>>symbol i=none v=circle;
>>symbol1 v=circle i=none c=black pointlabel=(h=1.0 '#rate');
>>title "Bubble Plot";
>>proc gplot data=test anno=annobub;
>>plot rate*lvlord=series /
>>autovref autohref
>>nolegend
>>noframe
>>grid
>>lhref=3
>>vaxis=axis1
>>haxis=axis2;
>>;
>>plot2 rate * lvlord / vaxis=axis1 noaxis
>>;
>>format lvlord dataord.;
>>;
>>run;
>