Xarray image

In [1]:
import geoviews as gv
import geoviews.feature as gf
import xarray as xr
from cartopy import crs

gv.extension('matplotlib')

Define data

In [2]:
ensemble = xr.open_dataset('../../data/ensemble.nc')
dataset = gv.Dataset(ensemble, ['longitude', 'latitude', 'time'], crs=crs.PlateCarree())
images = dataset.to(gv.Image)
# Equivalent full definition:
# images = dataset.to(gv.Image, ['longitude', 'latitude'], 'surface_temperature', 'time')

Plot

In [3]:
%%opts Image [colorbar=True fig_size=250] (cmap='viridis')
images * gf.coastline
Out[3]:

Download this notebook from GitHub (right-click to download).