Open ImmaculateJSL opened 3 years ago
Damn, I thought we'd taken care of that case! There's special code for catching empty plots and all-NaN plots (where we pretty much have to make up some axes, since it's not possible to auto-range them), but this seems like a similar case we aren't yet catching.
Hmm; actually I can't reproduce this. Works fine with or without datashade
, for me using current HoloViews master (about to be released) as holoviews 1.14.1:
import pandas as pd, holoviews as hv, holoviews.operation.datashader as hd
hv.extension("bokeh")
df = pd.DataFrame(dict(x=[0,5,10],y=[0,0,0]))
points = hv.Points(df)
points
hd.datashade(points)
If that code acts differently for you, maybe update to the latest HoloViews using conda install -c pyviz/label/dev holoviews
and see if that fixes it.
Hmmm. I've tried running your example on my machine and I'm still getting a blank datashade plot, even when switching over to the development branch. Is there anything else I could provide to maybe help you pin-point this issue?
Hmm. Are there any errors on the JavaScript console (under More Tools/Developer Tools in Chrome)?
Wow; this is odd. I normally run my notebooks internally in VSCode, which is where I've noticed the issue with the datashader, but opening and running it in chrome I have no issues.
I guess for now on I'll be sure to display my plots in chrome.
Hmm; that's really strange. But Datashader works in VSCode when the points aren't aligned in a row? It's hard to imagine how VSCode would enter into this interface between HoloViews and Datashader. Very mysterious!
Yeah, this is a strange bug for sure.
Just checked again, and anything datashaded in VSCode that isn’t a single horizontal or vertical line renders properly.
I wonder if you're using different versions of holoviews, bokeh, or datashader when you're in VSCode compared to Jupyter...
I've taken this issue off of the 1.14.1 milestone because that release is imminent and we aren't able to reproduce this problem yet, but once it's pinned down we can re-add it to the appropriate next release milestone.
I've found another odd little bug when it comes to horizontal/vertical lines when using matplotlib as my plotting extension in both Jupyter and VSCode; it appears that the datashade method is returning an empty array.
Conversely, using plotly as my extension actually produces the expected datashaded plots in both Jupyter and VSCode.
Found yet another issue; I suspect they're related, so I decided to leave it in this thread, but I can create another if need be.
Note that this behavior appears to only be true when using hv.save()
for horizontal/vertical plots.
The problem is that I'm trying to automate the generation and export for multiple plots derived from a given dataset. The issue is that if the image/plot I'm trying to save hasn't been displayed in the notebook, the resulting output image will be blank.
import pandas as pd
import holoviews as hv
import holoviews.operation.datashader as hd
hv.extension("bokeh")
data = {
"x": [1, 2, 3],
"y": [0, 0, 0]
}
df = pd.DataFrame.from_dict(data)
points = hv.Points(df)
ds_points = hd.datashade(points)
ds_points
hv.save(ds_points, "test/cool.png")
import pandas as pd
import holoviews as hv
import holoviews.operation.datashader as hd
hv.extension("bokeh")
data = {
"x": [1, 2, 3],
"y": [0, 0, 0]
}
df = pd.DataFrame.from_dict(data)
points = hv.Points(df)
ds_points = hd.datashade(points)
hv.save(ds_points, "test/cool.png")
ALL software version info
Description of expected behavior and the observed behavior
When using holoviews' datashader operation on some datasets, some of the points coincidentally ended up being plotted together in a single, horizontal line. Unfortunately, the holoviews datashader operation seems to be unable to render such points while the vanilla datashader library can.
Complete, minimal, self-contained example code that reproduces the issue
Screenshots or screencasts of the bug in action
Plot Produced by Vanilla Datashader
Plot Produced by hd.datashade
Plot Produced by hv.Points