Classifying data into sets in grasshopper

Let’s say I have data of 700 numbers that ranges from 1 to 100. These numbers are generated from many points whose distances have been measured.

How can I classify those numbers into sets of

(a) 1-50

(b) 51-60

© 61-80

(d) 81-100 ?

And then assign different colour for each of the sets?

Data (a) = blue colour
Data (b) = green colour
Data © = yellow colour
Data (d) = yellow colour

if it’s only a few named ranges, this shows a pretty straight forward setup using native components.

I don’t understand the last part. How should I insert the final classified data generated into the legend colour component then in order to have

Data (a) = blue colour
Data (b) = green colour
Data © = yellow colour
Data (d) = yellow colour ?

Do you want to color/shade some geometry based on these values? If so, you could use a similar approach that is described here. It’s for slope analysis, but the grouping/coloring of geometry based on some ranges of values, is very similar.

Also, an example file is always helpful.

Check this demo as well.


Group By Dist_re.gh (13.5 KB)

Thanks! This looks really useful. I’ll surely check it out and revert back ASAP.

I have similiar problem. I want to change color depending on radius. If radius is 100 change color to blue. If radius is 150 change color to red.

You can use Stream Filter.


StreamFilterDemo.gh (12.2 KB)

1 Like

There is some issue with stream filter component.

color_arcs.3dm (35.6 KB) color_arcs.gh (22.2 KB)

That is not the fault ofStream Filter. It doesn’t accept a string for gate input.


color_arcs_re.gh (13.1 KB)

2 Likes

Check this as well.


color_arcs_reV2.gh (14.8 KB)

2 Likes

Nice. Thanks!

Sorry… You can simplify first one by grafting pattern input ofPicn’n’Choose.:sweat_smile:


color_arcs_reV3.gh (13.3 KB)

1 Like