hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Explorer doesn't infer the right x/y/groupby values for gridded data

Open pedroaugustosmribeiro opened this issue 1 year ago • 3 comments

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc) Python version: 3.8.18 (default, Sep 11 2023, 13:20:55) [GCC 11.2.0] hvplot version: 0.9.0 numpy version: 1.24.3 pandas version: 1.5.3 xarray version: 0.20.0 plotly version: 5.18.0 matplotlib version: 3.7.2 bokeh version: 3.1.1

Description of expected behavior and the observed behavior

When trying to use hvplot explorer with a temporal xarray.DataArray like da.hvplot.explorer() with alternative backends like matplotlib and plotly

Complete, minimal, self-contained example code that reproduces the issue

import sys

import bokeh
import hvplot.xarray
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly
import xarray as xr

print('Python version: ', sys.version)
print('hvplot version:', hvplot.__version__)
print('numpy version: ', np.__version__)
print('pandas version: ', pd.__version__)
print('xarray version: ', xr.__version__)
print('plotly version: ', plotly.__version__)
print('matplotlib version: ', matplotlib.__version__)
print('bokeh version:' , bokeh.__version__)

%matplotlib inline
da = xr.open_dataarray('test_hvplot.nc')

hvplot.extension('matplotlib')
a = da.hvplot.explorer()
a

Stack traceback and/or browser JavaScript console output

WARNING:param.Image02085: Image dimension time is  not evenly sampled to relative tolerance of 0.001. 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 Image constructor.
WARNING:param.Image02085: Image dimension time is  not evenly sampled to relative tolerance of 0.001. 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 Image constructor.
/home/pedro/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:999: RuntimeWarning: All-NaN slice encountered
  el_min, el_max = np.nanmin(values), np.nanmax(values)

---------------------------------------------------------------------------
UFuncTypeError                            Traceback (most recent call last)
File [~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:974](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:974), in MimeBundleFormatter.__call__(self, obj, include, exclude)
    [971](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:971)     method = get_real_method(obj, self.print_method)
    [973](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:973)     if method is not None:
--> [974](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:974)         return method(include=include, exclude=exclude)
    [975](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:975)     return None
    [976](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/IPython/core/formatters.py:976) else:

File [~/.local/lib/python3.8/site-packages/panel/viewable.py:1095](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:1095), in Viewer._repr_mimebundle_(self, include, exclude)
   [1094](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:1094) def _repr_mimebundle_(self, include=None, exclude=None):
-> [1095](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:1095)     return self._create_view()._repr_mimebundle_(include, exclude)

File [~/.local/lib/python3.8/site-packages/panel/viewable.py:771](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:771), in Viewable._repr_mimebundle_(self, include, exclude)
    [768](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:768)     loaded = hv.extension._loaded
    [770](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:770) if config.comms in ('vscode', 'ipywidgets'):
--> [771](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:771)     widget = ipywidget(self)
    [772](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:772)     if hasattr(widget, '_repr_mimebundle_'):
    [773](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:773)         return widget._repr_mimebundle_(include=include, exclude=exclude), {}

File [~/.local/lib/python3.8/site-packages/panel/io/notebook.py:515](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/io/notebook.py:515), in ipywidget(obj, doc, **kwargs)
    [513](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/io/notebook.py:513) from ..pane import panel
    [514](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/io/notebook.py:514) doc = doc if doc else Document()
--> [515](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/io/notebook.py:515) model = panel(obj, **kwargs).get_root(doc=doc)
    [516](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/io/notebook.py:516) widget = BokehModel(model, combine_events=True)
    [517](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/io/notebook.py:517) if hasattr(widget, '_view_count'):

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:306](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:306), in Panel.get_root(self, doc, comm, preprocess)
    [302](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:302) def get_root(
    [303](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:303)     self, doc: Optional[Document] = None, comm: Optional[Comm] = None,
    [304](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:304)     preprocess: bool = True
    [305](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:305) ) -> Model:
--> [306](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:306)     root = super().get_root(doc, comm, preprocess)
    [307](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:307)     # ALERT: Find a better way to handle this
    [308](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:308)     if hasattr(root, 'styles') and 'overflow-x' in root.styles:

File [~/.local/lib/python3.8/site-packages/panel/viewable.py:666](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:666), in Renderable.get_root(self, doc, comm, preprocess)
    [664](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:664)     root_view = wrapper
    [665](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:665) else:
--> [666](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:666)     root = self._get_model(doc, comm=comm)
    [667](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:667)     root_view = self
    [668](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/viewable.py:668)     if preprocess:

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174), in Panel._get_model(self, doc, root, parent, comm)
    [172](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:172) root = root or model
    [173](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:173) self._models[root.ref['id']] = (model, parent)
--> [174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174) objects, _ = self._get_objects(model, [], doc, root, comm)
    [175](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:175) props = self._get_properties(doc)
    [176](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:176) props[self._property_mapping['objects']] = objects

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:156](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:156), in Panel._get_objects(self, model, old_objects, doc, root, comm)
    [154](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:154) else:
    [155](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:155)     try:
--> [156](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:156)         child = pane._get_model(doc, root, model, comm)
    [157](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:157)     except RerenderError as e:
    [158](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:158)         if e.layout is not None and e.layout is not self:

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174), in Panel._get_model(self, doc, root, parent, comm)
    [172](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:172) root = root or model
    [173](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:173) self._models[root.ref['id']] = (model, parent)
--> [174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174) objects, _ = self._get_objects(model, [], doc, root, comm)
    [175](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:175) props = self._get_properties(doc)
    [176](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:176) props[self._property_mapping['objects']] = objects

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:156](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:156), in Panel._get_objects(self, model, old_objects, doc, root, comm)
    [154](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:154) else:
    [155](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:155)     try:
--> [156](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:156)         child = pane._get_model(doc, root, model, comm)
    [157](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:157)     except RerenderError as e:
    [158](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:158)         if e.layout is not None and e.layout is not self:

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174), in Panel._get_model(self, doc, root, parent, comm)
    [172](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:172) root = root or model
    [173](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:173) self._models[root.ref['id']] = (model, parent)
--> [174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174) objects, _ = self._get_objects(model, [], doc, root, comm)
    [175](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:175) props = self._get_properties(doc)
    [176](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:176) props[self._property_mapping['objects']] = objects

File [~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:211](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:211), in Tabs._get_objects(self, model, old_objects, doc, root, comm)
    [209](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:209) else:
    [210](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:210)     try:
--> [211](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:211)         rendered[pref] = child = pane._get_model(doc, root, model, comm)
    [212](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:212)     except RerenderError as e:
    [213](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/tabs.py:213)         if e.layout is not None and e.layout is not self:

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174), in Panel._get_model(self, doc, root, parent, comm)
    [172](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:172) root = root or model
    [173](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:173) self._models[root.ref['id']] = (model, parent)
--> [174](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:174) objects, _ = self._get_objects(model, [], doc, root, comm)
    [175](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:175) props = self._get_properties(doc)
    [176](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:176) props[self._property_mapping['objects']] = objects

File [~/.local/lib/python3.8/site-packages/panel/layout/base.py:156](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:156), in Panel._get_objects(self, model, old_objects, doc, root, comm)
    [154](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:154) else:
    [155](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:155)     try:
--> [156](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:156)         child = pane._get_model(doc, root, model, comm)
    [157](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:157)     except RerenderError as e:
    [158](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/layout/base.py:158)         if e.layout is not None and e.layout is not self:

File [~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:411](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:411), in HoloViews._get_model(self, doc, root, parent, comm)
    [409](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:409)     plot = self.object
    [410](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:410) else:
--> [411](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:411)     plot = self._render(doc, comm, root)
    [413](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:413) plot.pane = self
    [414](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:414) backend = plot.renderer.backend

File [~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:506](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:506), in HoloViews._render(self, doc, comm, root)
    [503](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:503)     if comm:
    [504](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:504)         kwargs['comm'] = comm
--> [506](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/panel/pane/holoviews.py:506) return renderer.get_plot(self.object, **kwargs)

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:241](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:241), in Renderer.get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
    [238](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:238)     defaults = [kd.default for kd in plot.dimensions]
    [239](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:239)     init_key = tuple(v if d is None else d for v, d in
    [240](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:240)                      zip(plot.keys[0], defaults))
--> [241](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:241)     plot.update(init_key)
    [242](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:242) else:
    [243](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/renderer.py:243)     plot = obj

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:256](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:256), in MPLPlot.update(self, key)
    [254](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:254) def update(self, key):
    [255](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:255)     if len(self) == 1 and key in (0, self.keys[0]) and not self.drawn:
--> [256](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:256)         return self.initialize_plot()
    [257](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:257)     return self.__getitem__(key)

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:45](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:45), in mpl_rc_context.<locals>.wrapper(self, *args, **kwargs)
     [43](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:43) def wrapper(self, *args, **kwargs):
     [44](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:44)     with _rc_context(self.fig_rcparams):
---> [45](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/plot.py:45)         return f(self, *args, **kwargs)

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:578](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:578), in ElementPlot.initialize_plot(self, ranges)
    [575](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:575) self._trigger = []
    [576](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:576) Stream.trigger(trigger)
--> [578](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:578) return self._finalize_axis(self.keys[-1], element=element, ranges=ranges,
    [579](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:579)                            **axis_kwargs)

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:187](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:187), in ElementPlot._finalize_axis(self, key, element, title, dimensions, ranges, xticks, yticks, zticks, xlabel, ylabel, zlabel)
    [184](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:184)         self._finalize_ticks(axis, dimensions, xticks, yticks, zticks)
    [186](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:186)     # Set axes limits
--> [187](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:187)     self._set_axis_limits(axis, element, subplots, ranges)
    [189](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:189) # Apply aspects
    [190](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:190) if self.aspect is not None and self.projection != 'polar' and not self.adjoined:

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:366](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:366), in ElementPlot._set_axis_limits(self, axis, view, subplots, ranges)
    [362](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:362) """
    [363](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:363) Compute extents for current view and apply as axis limits
    [364](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:364) """
    [365](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:365) # Extents
--> [366](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:366) extents = self.get_extents(view, ranges)
    [367](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:367) if not extents or self.overlaid:
    [368](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/element.py:368)     axis.autoscale_view(scalex=True, scaley=True)

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/raster.py:41](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/raster.py:41), in RasterBasePlot.get_extents(self, element, ranges, range_type)
     [40](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/raster.py:40) def get_extents(self, element, ranges, range_type='combined'):
---> [41](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/raster.py:41)     extents = super().get_extents(element, ranges, range_type)
     [42](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/raster.py:42)     if self.situate_axes or range_type not in ('combined', 'data'):
     [43](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/mpl/raster.py:43)         return extents

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1450](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1450), in GenericElementPlot.get_extents(self, element, ranges, range_type, dimension, xdim, ydim, zdim)
   [1447](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1447)     return extents
   [1449](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1449) if self.apply_ranges:
-> [1450](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1450)     range_extents = self._get_range_extents(element, ranges, range_type, xdim, ydim, zdim)
   [1451](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1451) else:
   [1452](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1452)     range_extents = (np.NaN,) * num

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1367](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1367), in GenericElementPlot._get_range_extents(self, element, ranges, range_type, xdim, ydim, zdim)
   [1364](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1364)         trigger = True
   [1366](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1366)     mz0, mz1 = get_minimum_span(z0, z1, zspan)
-> [1367](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1367) xpad, ypad, zpad = self.get_padding(element, (x0, y0, z0, x1, y1, z1))
   [1369](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1369) if range_type == 'soft':
   [1370](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1370)     x0, x1 = xsrange

File [~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1335](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1335), in GenericElementPlot.get_padding(self, obj, extents)
   [1333](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1333) aspect = self.get_aspect(xspan, yspan)
   [1334](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1334) if aspect > 1:
-> [1335](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1335)     xpad = tuple(xp/aspect for xp in xpad) if isinstance(xpad, tuple) else xpad/aspect
   [1336](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1336) else:
   [1337](https://vscode-remote+ssh-002dremote-002braoni.vscode-resource.vscode-cdn.net/home/pedro/scripts/~/.local/lib/python3.8/site-packages/holoviews/plotting/plot.py:1337)     ypad = tuple(yp*aspect for yp in ypad) if isinstance(ypad, tuple) else ypad*aspect

UFuncTypeError: ufunc 'divide' cannot use operands with types dtype('int64') and dtype('<m8[ns]')

Screenshots or screencasts of the bug in action

  • [ ] I may be interested in making a pull request to address this

pedroaugustosmribeiro avatar Feb 22 '24 18:02 pedroaugustosmribeiro

I have setup a Jupyter Notebook for reproducing the issue with an example of my data at https://github.com/pedroaugustosmribeiro/test_hvplot

pedroaugustosmribeiro avatar Feb 22 '24 19:02 pedroaugustosmribeiro

Thanks @pedroaugustosmribeiro for reporting this issue and the example to reproduce it! I think what it comes down to is that the explorer doesn't pick nice defaults like .hvplot() does. When da.hvplot.image() is called, hvPlot infers x should be lon and y should be lat.

image

However, the explorer doesn't and ends up with the slightly awkward combination of time for x and lon for y.

image

With the Bokeh plotting library this combination sorts of work, or at least it doesn't break immediately. Forcing the explorer to be instantiated with better values, it works well with the matplotlib and plotly backends:

image

maximlt avatar Mar 05 '24 17:03 maximlt

oh, thank you @maximlt

pedroaugustosmribeiro avatar Mar 05 '24 21:03 pedroaugustosmribeiro