-
-
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
Slightly corrupted images when using datashade
with bokeh backend (but not with plotly)
#5866
Comments
Thank you Hoxbro. Sure, I see: Python : 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:17) [GCC 12.2.0]
Operating system : Linux-5.15.0-78-generic-x86_64-with-glibc2.35
Panel comms : default
holoviews : 1.17.1
bokeh : 3.2.2
colorcet : 3.0.1
cudf : -
dask : 2023.8.1
datashader : 0.15.2
geoviews : -
hvplot : 0.8.4
ibis : -
IPython : 8.14.0
jupyter_bokeh : -
jupyterlab : 4.0.5
matplotlib : 3.7.2
networkx : 3.1
notebook : 7.0.2
numba : 0.57.1
numpy : 1.24.4
pandas : 2.0.3
panel : 1.2.1
param : 1.13.0
PIL : 10.0.0
plotly : 5.16.1
pyarrow : 12.0.1
scipy : 1.11.2
skimage : 0.21.0
spatialpandas : -
streamz : 0.6.4
xarray : 2023.8.0 |
I can't see any obvious reasons why it does not work. Can you paste the output of For what it is worth, I created a new environment and got. Python : 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:34:09) [GCC 12.3.0]
Operating system : Linux-6.4.6-76060406-generic-x86_64-with-glibc2.35
Panel comms : default
holoviews : 1.17.1
bokeh : 3.2.2
colorcet : 3.0.1
cudf : -
dask : 2023.8.1
datashader : 0.15.2
geoviews : -
hvplot : -
ibis : -
IPython : 8.14.0
jupyter_bokeh : -
jupyterlab : 4.0.5
matplotlib : 3.7.2
networkx : -
notebook : 7.0.2
numba : 0.57.1
numpy : 1.24.4
pandas : 2.0.3
panel : 1.2.1
param : 1.13.0
PIL : 10.0.0
plotly : -
pyarrow : 13.0.0
scipy : 1.11.2
skimage : -
spatialpandas : -
streamz : -
xarray : 2023.8.0 |
Wow - that's a very short list. I unfortunately never got very good at Conda or understanding how dependencies are controlled. In any case, here is my conda list output:
|
It was the output of I can't see any clear problem with that list. Can you try to create a new environment with: conda create -n tmp_holoviews python=3.11 holoviews jupyterlab datashader
conda activate tmp_holoviews
jupyter lab And from there create a new notebook with: import holoviews as hv
import numpy as np
import pandas as pd
from holoviews.operation.datashader import datashade
N = 10
x = np.linspace(0, 1000, N)
y = np.sin(x / 30)
df = pd.DataFrame(dict(x=x, y=y))
hv.extension("bokeh")
opts = hv.opts.RGB(width=900, height=400)
img = datashade(hv.Path(df, kdims=["x", "y"]), width=900, height=400)
img.opts(opts)
img What is your zoom level in your browser? |
Interesting! Okay, I did exactly the steps described above, but I see the artifact in Chrome, but Firefox there is no artifact. (I checked that my zoom level in Chrome is 100%. In fact I checked zoom levels from 50% to 200% and the artifact is there no matter what) Chrome: Version 115.0.5790.170 (Official Build) (64-bit) Firefox: 116.0.3 (64-bit) Mozilla Firefox Snap for Ubuntu canonical-002 - 1.0 |
For me on Chrome the artifact is always present, including across zoom levels, except that unless I completely hallucinated it, the first time I ran the OP's code there was no artifact. I don't mean the first time in a session, or the first time executing a notebook cell, I mean chronologically the first time. I was completely unable to reproduce that correct output ever again even after restarting everything I could think to restart, so I decided I had been confused somehow, but @hoxbro , at least please check that you get the correct output after several re-executions of that cell. Here's the output for me. |
This is likely then a bug in the frontend code specific to Chrome. Is there some way to save the image just before it gets sent to the frontend? Maybe then I could inspect it and see if it contains the artifact. If it doesn''t, then I suspect it is being resized by a few pixels height and width in the javascript code. (But, I looked at devtools and couldn't figure out if it was or not, since the whole thing is made into one composite image with border and bokeh toolbars and axes etc. |
I can recreate it in Google Chrome (I was using Firefox). I think your suspicions are very likely culprits, but I don't at the top of my head know how to test it. I will try to investigate it later this week. |
(Issue also illustrated on discourse)
Using:
bokeh 3.2.2
plotly 5.16.1
datashader 0.15.2
holoviews 1.17.1
With the following setup:
When I do:
I see a line with artifacts. This is some sort of bug (see below). I've stepped through a lot of the code in holoviews/plotting/bokeh/element and other files, for example. Unfortunately it seems too complex for me to debug. But, I'm thinking there is some bug in the downstream processing, since the output images that come directly from datashader look perfect (see below)
Any help would be much appreciated. As it is, this is unfortunately not usable quality, it is too visually distracting.
When I instead use the plotly backend but everything else the same:
The line has no artifacts:
Finally, I can confirm that this is not an issue with datashader image generation itself. When I do:
I see a perfectly rendered line plot:
Thanks in advance!
The text was updated successfully, but these errors were encountered: