-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find a solution for bokeh colormaps #1502
Comments
I've thought a bit about this but haven't come to any firm conclusions. @jbednar What do you think is the best approach? |
Most bokeh palettes contain only a few colors, but bokeh does supply some 256-color palettes along with some functions to generate arbitrarily long palettes. Datashader already interpolates the palettes into a continuous range, and if the code in bokeh for handling palettes does not already include such functionality, I'd argue that the code from datashader should be added to Bokeh in a PR so that Bokeh users can handle more colors easily. Meanwhile, I don't think this should be the responsibility of HoloViews. I think we can just rely on the four perceptually uniform ones from mpl, which are already provided with Bokeh, plus any from colorcet that are useful, and never show any examples that use a non-uniform colormap. If it turns out we only need "fire", then that can be included directly in HoloViews, but colorcet has no dependencies, so having that as a dependency seems reasonable to me. |
I suppose we could have a mechanism that warns/excepts when a colormap is used that has a missing dependency (i.e colorcet or matplotlib). |
Sure, though relying on colorcet is trivial, whereas we'd want to avoid ever relying on mpl when mpl is not in use, due to how tricky it is to get its various backends installed. |
I think we should write our code so that not having colorcet doesn't break holoviews, making it an optional dependency in the strict sense (i.e from the code's perspective) even if we do always include it when installing holoviews core. |
Makes sense, though it would require copying in the definition of fire for it to be valid as a default. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As part of #1484 I added support for supplying explicit lists of colors as colormaps and selecting some of the inbuilt bokeh palettes as strings. In doing this I discovered that using bokeh palettes is not sufficient, they contain at most 11 colors and do not interpolate between the colors which is not very nice for continuous values. This means for the time being we still rely on the colormaps shipped with matplotlib. I see a number of solutions:
The text was updated successfully, but these errors were encountered: