I have to create an heap map from a matrix of double values (both positive and negative), but how can I get a color from those values within a range between green and red?
Thanks
I have to create an heap map from a matrix of double values (both
Share
Assuming green is positive and red is negative like in most red-green heatmaps, find the most positive value among the positive values and divide them by it and then find the most negative value among the negative values and divide them by it. Multiply the ratios for the positive values by 255 for green and keeping red as 0 and the ratios for the negative values by 255 for red and keeping green as 0. So when the value is 0, it should be black; when the value is at the most positive, it’s fully green; when the value is at the most negative, it’s fully red.