biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.79k stars 997 forks source link

Hierarchical Clustering: change of cluster colors at k=18 #5696

Closed ajdapretnar closed 2 years ago

ajdapretnar commented 2 years ago

What's wrong?

Not sure whether this is a bug or designed intentionally, so reporting it just in case. Clusters change colors when selecting clusters in the dendrogram in Hierarchical Clustering after level 18 (when the number of clusters is 18). Initial cluster colors become different when passing from 17 to 18.

How can we reproduce the problem?

Change cluster numbers in the dendrogram.

hc-colors

What's your environment?

janezd commented 2 years ago

This is a result of intentional decision.

DefauiltRGBPalette has 17 colors, starting with some that are presumed to look nicely and be distinguishable, and continuing with some that are still as distinguishable as possible. After 17, it switches to a different, Glasbey palette. See https://github.com/biolab/orange3/blob/master/Orange/widgets/utils/colorpalettes.py#L162.

We could use Glasbey from the beginning, but we preferred a different set of colors for smaller palettes. Most widgets do not show that many colors anyway, so our smaller palette is better. For dendrogram, which occasionally does, we could use Glasbey all the time, but then the colors would not match those in other widgets.