Open peterroelants opened 2 months ago
It seems to work if you use Overlay
over 'NdOverlay`?
meshes = [
hv.QuadMesh(da.where(da > 0), kdims=["x", "y"], vdims=["D"]).opts(alpha=0.5)
for da in samples.values()
]
overlay = hv.Overlay(meshes, kdims=["sample"])
shade(
rasterize(overlay),
aggregator=datashader.by("sample"),
)
It seems to work if you use Overlay over 'NdOverlay`?
Using Overlay
instead of NdOverlay
does not color the meshes ("sample" dimension) differently:
What about this?
What about this?
Hey, thanks, however it still seems like it's missing some shading between the two groups.
I've been playing around with the image_rtol
value and if I set it to something really large (e.g. hv.config.image_rtol = 1e6
) it seems to work:
However, I wonder what the implications are of setting hv.config
's image_rtol
to such a high value. Is image_rtol
only used for validation and nothing else?
Description of expected behavior and the observed behavior
Datashading an NdOverlay of Quadmeshes (with different axis bins) does not work and results in:
ValueError: Supplied Image bounds do not match the coordinates defined in the data. Bounds only have to be declared if no coordinates are supplied, otherwise they must match the data. To change the displayed extents set the range on the x- and y-dimensions.
I tried setting
hv.config.image_rtol = 1
but with no resultComplete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
Stack trace
```python-traceback WARNING:param.RGB01051: RGB dimension(s) x and y are not evenly sampled to relative tolerance of 1. Please use the QuadMesh element for irregularly sampled data or set a higher tolerance on hv.config.image_rtol or the rtol parameter in the RGB constructor. --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File [~/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/IPython/core/formatters.py:977](http://localhost:8888/home/peter/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/IPython/core/formatters.py#line=976), in MimeBundleFormatter.__call__(self, obj, include, exclude) 974 method = get_real_method(obj, self.print_method) 976 if method is not None: --> 977 return method(include=include, exclude=exclude) 978 return None 979 else: File [~/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/core/dimension.py:1286](http://localhost:8888/home/peter/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/core/dimension.py#line=1285), in Dimensioned._repr_mimebundle_(self, include, exclude) 1279 def _repr_mimebundle_(self, include=None, exclude=None): 1280 """ 1281 Resolves the class hierarchy for the class rendering the 1282 object using any display hooks registered on Store.display 1283 hooks. The output of all registered display_hooks is then 1284 combined and returned. 1285 """ -> 1286 return Store.render(self) File [~/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/core/options.py:1428](http://localhost:8888/home/peter/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/core/options.py#line=1427), in Store.render(cls, obj) 1426 data, metadata = {}, {} 1427 for hook in hooks: -> 1428 ret = hook(obj) 1429 if ret is None: 1430 continue File [~/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:287](http://localhost:8888/home/peter/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py#line=286), in pprint_display(obj) 285 if not ip.display_formatter.formatters['text[/plain](http://localhost:8888/plain)'].pprint: 286 return None --> 287 return display(obj, raw_output=True) File [~/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:261](http://localhost:8888/home/peter/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py#line=260), in display(obj, raw_output, **kwargs) 259 elif isinstance(obj, (HoloMap, DynamicMap)): 260 with option_state(obj): --> 261 output = map_display(obj) 262 elif isinstance(obj, Plot): 263 output = render(obj) File [~/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:149](http://localhost:8888/home/peter/mambaforge/envs/lcms_polymer_env/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py#line=148), in display_hook.More info:
hv.config.image_rtol
to 1, but to no avail. This thread led me to believe that the issue might be how datashader works?datashade(
andshade(rasterize(
.rasterize
by itself seems to work fine (but doesn't shade the data, which I need).ALL software version info