INQUIRE: Color gradient based on percentages

Hi there, me again.

So, I am now evaluating some city scenarios based on the % of food coverage that I can grown in total in a year. I decided to visualize it using a gradient that shows which plots have a better performance. Unfortunately, the way I have learned to do this does not help me to evaluate against other scenarios.


210824 - Gradient.gh (8.5 MB)

Basically I Reparametrize the values and state a low and max values, but every scenario has a different low and max.

For a better evaluation of every scenario I would like to establish the gradient based on percentages: 0, 25, 50, 75, 100. With everything over 100% getting the max gradient value.

I have been browsing on the forum and testing some of the options but I have yet to find the correct solution.

Thanks in advance.

Well I’ll be damned, seems to me that sometimes some of our questions have simple answers. I just skipped the Remap Numbers section of the definition and set the Lower Limit = 0 and Upper Limit = 100 in my Gradient.

Seems to work and it shows lots of different colors finally. Any chance I might have missed something though? Did I manage to set every item over >100 to 100?

Correct, by settings the upper limit to 100 and connecting all the original numbers (many of them being above 100), the gradient will turn all those values close to 100 and beyond to red.

You have a really high number on your list (1463.17). With the remapping, that outlier was messing up your color scale. That number would become red, but the rest being way lower would populate the rest of the gradient.

1 Like

@dariocorral I normally use this trick to define the thresholds between groups of numbers.
(The integer component is used to round the numbers up or down)

1 Like

Hi there @ign24680 thanks for the answer and tips. The Mesh is a very nice one for visualization purposes. What I see here is that by rounding the numbers I basically set every unit into one of the predefined 5 categories (0, 25, 50, 75, 100) but then the tiny differences between one and another unit (e.g. 25% vs 28%) are lost.
either way it helped me confirm my solution. Thanks a lot again!


210824 - Gradient3.gh (8.5 MB)

@dariocorral
This way you can set up your own custom %. I guess that´s closer to what you were looking for? You can add more numbers (and colors) for more refined analysis.