How to specify colormap for categories when using `ds.count_cat()`

I’m trying to use a custom mapping from categories to colors when datashading categories with ds.count_cat(). How can I do this, if it’s possible?

I tried using the cmap keyword argument but it seems to be ignored.

Sorry if this has been answered elsewhere, but I couldn’t find the answer after several minutes of checking the docs, GitHub, and StackOverflow.

We should probably issue a warning suggesting the right solution. When using count_cat you should use a color_key, either mapping each category to a color explicitly as a dictionary or providing a list of colors at least as long as the number of categories.

Thanks! I could submit a PR for that—or perhaps even better, add some documentation—if you could point me in direction of the relevant files?

To be clear you’re using datashader directly or via HoloViews?

I’m using it via Holoviews (hv.operations.datashader).