1

Setup is a xarray.Dataset with two variables and a grid of values.

import xarray as xr
import numpy as np
import hvplot.xarray

ds = xr.Dataset({
    'temp': (('lon', 'lat'), 15 + 8 * np.random.randn(2, 2)),
    'precip': (('lon', 'lat'), 10 * np.random.rand(2, 2)),
    },
    coords={
        'lon': [-99.83, -99.32],
        'lat': [42.25, 42.21],
    })

Extrapolating from the hvplot docs, I expected subplots for each variable and a shared colorbar (z-axis) would result from:

ds.hvplot(z=['temp', 'precip'], subplots=True)

That gives an UnboundLocalError and several variants are no better. Am I doing it wrong or is it not implemented? If that latter, any way to manually produce two hvplot.image plots side-by-side with a shared colorbar?

Ian
  • 1,062
  • 1
  • 9
  • 21
  • 1
    I can reproduce the `UnboundLocalError` and have raised an issue on hvplot: https://github.com/pyviz/hvplot/issues/336 . I would have thought that `ds.hvplot(z='temp') + ds.hvplot(z='precip')` would be enough to get the colorbar ranges to be shared, but it doesn't look like that's the case. – James A. Bednar Oct 14 '19 at 16:45

0 Answers0