I am creating a heatmap. I was using my personal choice of colors, But there are other colors that don't have the name to write in the "Rang attribute Map Dataset"( "rattrap" dataset in my code). How Can I use the different colors using the color hex codes or any other codes? I tried replacing color codes with color names, but it didn't work. thank you for your suggestions and help.
Present output:
This are the colors I want to use instead of present colors in my output
proc freq data = sashelp.cars noprint;
table origin*type / out = cars(keep = count origin type);
run;
data attrmap;
retain id "myid";
length min 4. max $5.;
input min max $ color $;
datalines;
0 10 green
11 20 yellow
21 75 orange
76 _max_ red
;
run;
ods html;
proc sgplot data=cars rattrmap=attrmap noautolegend;
heatmapparm x=origin y=type
colorresponse=count/ rattrid=myid outline name='range';
text x=origin y=type text=count / textattrs=(size=8pt);
gradlegend 'range'/title= 'Range of cars';
yaxis fitpolicy=split label="Type";
xaxis label="Origin";
run;
ods html close;
Replace the "#" with "cx" (e.g. #000000 becomes cx000000)
Replace the "#" with "cx" (e.g. #000000 becomes cx000000)
Perfect. It worked. Thanks
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.