biolab / orange3

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

Heatmap palettes #4445

Closed Hrovatin closed 4 years ago

Hrovatin commented 4 years ago

There are many uniform heatmap palettes prettier than the current ones. Bokeh (http://docs.bokeh.org/en/1.3.2/docs/reference/palettes.html#large-palettes) has 256 length paletes that can be converted to RGB from hex. Example: On top (left, right) are current Orange palettes and below bokeh alternatives. Screenshot from 2020-02-21 15-59-20

janezd commented 4 years ago

For the left one, I actually prefer the top one. For the right, the bottom. But I won't object to changing any palette -- until the next release. After that, we'll have problems with settings.

Bear in mind that palettes must also look nice in scatter plots and elsewhere.

Suggest what should be replaced by what, then let's vote.

Hrovatin commented 4 years ago

If anyone wants to try them: The code to generate the palette colurs:

import bokeh.palettes

def hex_to_rgb(hex):
    return [int(hex.strip('#')[i:i + 2], 16) for i in (0, 2, 4)]

print([hex_to_rgb(col) for col in bokeh.palettes.viridis(256)])
print([hex_to_rgb(col) for col in bokeh.palettes.inferno(256)])
print([hex_to_rgb(col) for col in bokeh.palettes.magma(256)])
print([hex_to_rgb(col) for col in bokeh.palettes.plasma(256)])
print([hex_to_rgb(col) for col in bokeh.palettes.cividis(256)])

Or already formatted in the Orange palettes: https://github.com/Hrovatin/orange3/blob/1014c5c12faf716d658031c74b897db20519669b/Orange/widgets/utils/colorpalettes.py#L641

ajdapretnar commented 4 years ago

I think the reason not to go with bokeh was that we don't want to introduce yet another dependency. And while I think bokeh is great, I am not in favour of adding it to Orange.

janezd commented 4 years ago

We can use bokeh palettes without adding a dependency (unless something in the license prohibits it). We can just copy palettes into Orange, like I did with colorcet palettes.

It's just a question of which palettes we like better.

ajdapretnar commented 4 years ago

I like the existing ones.

Hrovatin commented 4 years ago

Changes: