✊🏿 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?
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.


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? :slight_smile:

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.