βπΏ Black Lives Matter. Please consider donating to Black Girls Code today.
β‘οΈ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

# Colorscales based on quantitative measure?

Hi all,

Is it possile to create colorscales on semi-involved logic?
Example:
I have the groups A, B, C. But each data point can be different degrees of these groups.
So say A = red, B = blue, C = yellow.
Then if I have a point that is 80% A, then it should be dark red. If 40% A, then light red.
Luckily, the data points will never overlap the different groups.

Thanks!

Hmm. I donβt quite understand. How can a point be 80% of A?

Okay so a bit more context. We are doing research on Brain Cancer.
Here, genes do most often mutate in groups rather than alone.

So say that a group is called βAβ but that βAβ is made up of 5 genes. Genes βa1β, a2", βa3β, a4", and βa5β. If a particular datapoint has any mutation in any of the a_i genes then it is in group A. If it has mutation in 4 out of those 5 genes then it would be - as an example - β80% Aβ, from (4/5).

Makes sense?

So I have a binary row vector for each data point where 1 represent a mutated gene and 0 represents no mutation.
So to assign a color, I would have to first check exactly which genes have mutated and then how many inside that group.