Open Noskario opened 2 years ago
Thanks for filing the issue! I can verify that I get the same result, but don't yet know what the cause is.
I'm still not quite sure why this behavior happens, but the upcoming Datashader release, currently installable as a dev version using conda install -c pyviz/label/dev
, should have two new features relevant to it:
shade
has a new option rescale_discrete_values
, which the next HoloViews release should allow you to specify in datashade
(and which is likely to become the default), so that isolated pixels are fully visible when you zoom into their general area. This might address why you were using any
.any
and count
, and I've verified that using ds.any_f32
doesn't suffer from this problem on your example. I'm not sure why the datatype would matter here, and that's a clue for tracking this down, but meanwhile just use any_f32
instead of any
.Also, instead of any version of any
(no pun intended), you can consider using min_alpha=128
(or similar), which should ensure that even isolated points are fully visible, at the expense of a lower dynamic range to indicate point density.
software version info
numpy 1.20.3 , pandas 1.3.3 , bokeh 2.3.3 , holoviews 1.14.6 , datashader 0.13.0 ,
Description of expected behavior and the observed behavior
I want to make a scatterplot (with color for categories) where there are some sparse points that I still want to see even if there are other regions with much higher density. I think
ds.any()
should be the way to go in this case. Unfortunately, when I use dynspread on this plot, the points disappear and I the whole plot that datashader produces gets a strange background-color. (Interestingly this color is not always the same...)Have a look at the following example:
Complete, minimal, self-contained example code that reproduces the issue
We get the following result: