Closed Hrovatin closed 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.
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
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.
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.
I like the existing ones.
Changes:
For linear palettes we had chosen the following from https://github.com/Hrovatin/orange3/blob/1014c5c12faf716d658031c74b897db20519669b/Orange/widgets/utils/colorpalettes.py: Blue-Green-Yellow2 (the previous Blue-Green-Yellow that had problems with white, but was then changed by Janez to end in pale yellow; should be named as Blue-Green-Yellow; could be set as the default), Viridis, Inferno, Blue-Magenta-Yellow, Dim gray. The others can be removed. Please not that for the linked file I am not sure if the naming of the new palettes (Viridis, Inferno) is appropriate - e. g. should it have 'linear' in it or not, as it is always written just Viridis / Inferno. However, they are supposed to be visually uniform: https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html
The order/naming of the palettes should be changed to: Linear, Diverging, Color blind friendly (note the name change), Other.
We had discussed that it would be nice to have symmetrical legend for diverging palettes (e.g. max and min have same absolute value). This would resolve the issue of seeming like there is an issue with the palette when the data is highly asymmetrical around the 0 (see the image below). However, this would lead to loos of information about min/max, which might need to be indicated else-how.
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.