holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.68k stars 401 forks source link

value-suppressing uncertainty palettes #3542

Open ericmjl opened 5 years ago

ericmjl commented 5 years ago

I saw this a year ago, but only now found the need to use value-suppressing uncertainty palettes. Is there a mechanism for defining such a color palette in holoviews? It's essentially a bivariate color palette.

https://medium.com/@uwdata/value-suppressing-uncertainty-palettes-426130122ce9

poplarShift commented 5 years ago

That looks pretty cool! You could probably emulate it using something like color=dim(value_dimension), alpha=dim(value_dimension_uncertainty). I know it's not the same, but it should make colours appear at least paler depending on their uncertainty.

jbednar commented 5 years ago

In our published work we have used the hv.HSV() element for this purpose, which is a ternary space where the Saturation can be used for uncertainty when using a white background, and the Value can be used for uncertainty when using a black background, with the Hue for the actual variable of interest. That works well only for a cyclic variable (orientation in our applications), unless you clip your value to a small range of the Hue space. And HSV is a highly nonlinear perceptual space, which has many disadvantages.

The complex_colormap package provides a perceptually uniform bivariate space that I've previously thought might be useful. I'd be happy to include that code in colorcet if someone wants to package it nicely into a PR; I haven't had any time to make that a priority. And I'd be happy to have other bivariate approaches in colorcet if they are perceptually uniform (perhaps cmap_builder); again it would be great to see a PR on colorcet. Once it's in colorcet we should be able to make use of it in HoloViews.

There is also some ternary colormap code from the author of colorcet's colormaps that could be useful.

poplarShift commented 5 years ago

Would it currently be feasible to implement a way of directly including such multivariate colormaps into holoviews Elements in the same way, using something like a color=[dim(vdim1), dim(vdim2)] syntax?