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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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