Open jbednar opened 7 years ago
It might be due to differing ranges between the two images, because the problem goes away when I make this temporary change that will typically force the ranges to be the same integer values:
$ git diff datashader/pandas.py
diff --git a/datashader/pandas.py b/datashader/pandas.py
index 5eb9335..1d8fc3c 100644
--- a/datashader/pandas.py
+++ b/datashader/pandas.py
@@ -17,6 +17,8 @@ def pandas_pipeline(df, schema, canvas, glyph, summary):
x_range = canvas.x_range or glyph._compute_x_bounds(df[glyph.x].values)
y_range = canvas.y_range or glyph._compute_y_bounds(df[glyph.y].values)
+ x_range = round(x_range[0]), round(x_range[1])
+ y_range = round(y_range[0]), round(y_range[1])
width = canvas.plot_width
height = canvas.plot_height
My eventual fix for my own situation was to find the range for each of the two plots myself and use a Canvas that included that full range. So maybe the solution is (a) a better error message somewhere (as the one here appears to be entirely misleading?), and (b) a utility to autorange a series of calls to be able to have a single Canvas to hold all of them consistently?
I'm not sure what the underlying problem is, but some of the Image objects generated by the transfer functions don't work as valid inputs to the other transfer functions, even though they visualize fine.
Here I'm calling stack on two different images, which works fine when I specify a range that leaves a small buffer around all the points when the images are created (first case above), but fails when stacking two images that used auto-ranging instead.
The message is a bit inscrutable, so I poked around a bit, and I thought that it could have something to do with spread reaching the boundary of the array, and I thought that I was seeing xarray types of object and values of NaNs, instead of the expected type of
uint32
and numeric values. But that's all hearsay, because when I actually isolated the example above, it all looks likeuint32
and no NaNs, and I see the same results with and without spreading, so I'll just leave it as "the example above works in one case and not the other, and I have no idea why".