BookmarkSubscribeRSS Feed
Giampaolo
Obsidian | Level 7

Dear SAS users,

I have divided a population of patients into quartiles of blood glucose and used a bar graph to represent the frequency of each quartiles among three groups of patients. The quartile progression from low to high is visualized by a progressively darkening color  (two color ramp).

I need now to visualize quartiles from  groups of this population using a different color for each group. The different colors are to clarify that it's the group, not the population, that has been divided into quartiles.  As of now all groups have the same color progression. I posted an example of two group quintiles from white to gray. How can I apply a different color ramp to the two groups?

Thank you!

 

My code is:

proc sgplot data = rankpergroup noautolegend ;
VBARPARM CATEGORY= CDM   response = PCT_ROW/ CLUSTERWIDTH= 0.7
group= q_G groupdisplay=cluster
colorresponse=q_G colormodel=twocolorramp;
xaxis label= 'Quartile of TWM Glucose' labelattrs= (size=14) VALUEATTRS =(size=14);
yaxis label = 'Patients (%)' labelattrs= (size=14) labelpos= center VALUEATTRS =(size=14);
run;

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

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 670 views
  • 0 likes
  • 1 in conversation