Dear all,
am tring to use color grading shades for the map I created but it's not showing any results. Am not sure if I have missing anything in my code. I will appreciate any help
proc template; define style styles.grad1; parent=styles.listing; style threecolorramp /startcolor=cream endcolor=darkblue; end; run; proc gmap data=mydata map=mapsgfk.germany all; id id; choro cases / statistic=first discrete levels=4 coutline=gray anno=myanno cdefault=CXFFFFFF legend=legend1; run; quit;
Hmm ... I'm not sure if levels=4 and discrete can be used together(?)
Rather than "statistic=first discrete levels=4", try just "levels=4".
What does your data look like?
I suppose you saw this.
I think you forgot to call the style.
you mean this?
ods listing style=styles.grad1;
ods html style=styles.grad1;
yes I tried that but I get colors like red green yellow etc. Although they are not included
Try twocolorramp, rather than threecolorramp.
@GraphGuy This is the code I used but unfortunately no changes. Attached is my data
legend1 label =(position=top j=c h=10pt "Number of cases" )
value=(f="Arial" h=8pt c=black justify=left)
origin=(78,18)
across=1
position= (right middle)
offset=(0.5)
space=1
mode=reserve
shape= bar(.17in,.13in )/*width and height*/
;
proc template;
define style styles.grad1;
parent=styles.listing;
style twocolorramp /startcolor=cream endcolor=darkblue;
end;
run;
ods listing style=styles.grad1;
ods html style=styles.grad1;
proc gmap data=mydata map=mydata all;
id id;
choro cases/ statistic=first discrete
levels=4
coutline=gray anno=myanno
cdefault=CXFFFFFF
legend=legend1;
run;
quit;
Hmm ... I'm not sure if levels=4 and discrete can be used together(?)
Rather than "statistic=first discrete levels=4", try just "levels=4".
What does your data look like?
@GraphGuy thanks it worked. I deleted discrete.
@GraphGuy here is my data
the map data is mapsgfk.germany and mapsgfk.germany_attr
Let's stick with one question per thread - this thread was for getting the gradient colors working, and we got that part working 🙂
Please start a fresh question/thread for the next question.
okay
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.