Data visualization with SAS programming

sgplot band keylegend

Reply
Regular Contributor
Posts: 194

sgplot band keylegend

In my HTML output I don't see the keylegend "bmi" (with title='Rate').
How do I fix this?
Thank you.

goptions device=png;
ods listing close;
ods html file='Band_Plots.html' path='C:\Documents and Settings\SASCode\Field_Office' style=styles.bmi;
ods graphics / reset width=900px height=700px imagename="Band_Plots" imagefmt=png;
title1 'Small';
proc sgplot data=mus;
band x=injury_cnt upper=upper_hours lower=lower_hours /
transparency=.5 group=category name="rate";
xaxis min=0 max=20 label='Injury' grid;
yaxis min=0 max=200000 label='Hours' grid;
keylegend "bmi" / position=bottom location=outside across=4 title='Rate: ';
series x=inj_u y=hour_u1 / datalabel=inj_yr lineattrs=(pattern=solid thickness=2px)
markerattrs=(symbol=circlefilled ) markers group=job_class name="pts";
keylegend "pts" / position=bottomleft location=outside across=1 title='Job:';
inset "Rate=Injury / Hours" " " /
position=bottomright textattrs=graphfootnotetext;
run;
SAS Super FREQ
Posts: 8,716

Re: sgplot band keylegend

Where is your name="bmi" option??? The link between the KEYLEGEND and the plot statement is the fact that you use the name= name(s) on the plot statement and on the keylegend statement. A KEYLEGEND statement has to be "linked" in this manner.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 129 views
  • 0 likes
  • 2 in conversation