I defined the dots on my gmap as follows:
if num_inj=1 then color='orange';
if num_inj>1 and inj_num<4 then color='red';
if num_inj>3 then color='maroon';
How do I add a legend to my gmap to show which level of num_inj corresponds to which color?
goptions device=png
gunit=pct htitle=6 htext=4
ftitle="arial" ftext="arial"
ctitle='black' ctext='black'
;
legend1 label=none value=(h=3 j=r) across=1;
pattern1 c=cxC3CD03 v=s;
goptions border cback=cx61CACA;
proc gmap map=ca_map data=ca_map anno=all_anno;
id state county;
choro state /
coutline=cx578B00
nolegend
discrete
legend=legend1
;
run;
quit;
Since you have a 'color' variable, I assume you're annotating markers/dots on a gmap?
If you annotate markers on a map, then you also have to annotate the color legend on the map - there's nothing built-in/automated to do it when you're using annotate.