Open ahuang11 opened 4 years ago
Same issue and I have a function that returns an hvplot so I do not have the option to manually set it. Has anyone found how to do it?
Nanoseconds are how the data is stored, which is why it is used for the title and the widget.
What is done behind the scenes is this:
A workaround, for now, is just to set the title on the plot, which removes it from the title:
A more advanced way is to convert the time delta to an int: (it is not perfect but it is a start)
import xarray as xr
import hvplot.xarray
ds = xr.tutorial.open_dataset('air_temperature')
ds.coords['time'] = (ds['time'] - ds['time'].isel(time=0)).values.astype("timedelta64[s]").astype(int)
ds.coords['time'].attrs["units"] = "seconds"
ds.hvplot('lon', 'lat')
Nanoseconds isn't used too frequently I think.
Or only holoviews: