BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
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;

Thank you.
1 REPLY 1
GraphGuy
Meteorite | Level 14
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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1293 views
  • 0 likes
  • 2 in conversation