Added separate color_key for datashader shade to use color cycle by default #1850
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #1697 changed the default cmap for datashader's
shade()
operation to "fire". @philippjfr wanted this replace datashader's default bluecmap
, but it also replaced datashader's defaultcolor_key
of Sets1to3, causing all categorical datashded output to be mapped to the first few colors of the fire colormap, which all look nearly identical (as reported in #1834).The original behavior for categories can be restored by explicitly passing
Sets1to3
toshade.cmap
whenever a category is used, but that's awkward and mysterious; the defaults should not be covering up categories.This PR adds a separate
color_key
parameter, defaulting to None (and thus falling through to Sets1to3), leavingcmap
at the defaultfire
value for now.Personally, I think
cmap
should not be defaulting tofire
either, becausefire
is intended only for black backgrounds, and the Bokeh defaults consistently use white backgrounds. So I wonder whether we should remove the "fire" default? E.g. if we setshade.cmap="#30a2da"
, we get behavior that is similar to the non-datashaded colors used by hv/bokeh:It's not very pretty, but seems better than fire: