BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

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:

SASuserlot_0-1711653244065.png

 

 

This are the colors I want to use instead of present colors in my output

SASuserlot_0-1711653086145.png

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Replace the "#" with "cx" (e.g. #000000 becomes cx000000)

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Replace the "#" with "cx" (e.g. #000000 becomes cx000000)

SASuserlot
Barite | Level 11

Perfect. It worked. Thanks

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 277 views
  • 1 like
  • 2 in conversation