I am plotting data using the GeoViews QuadMesh element. I can't find a way to expand the geographic region of my plot beyond a tiny bit past the edges of my data. I would like to provide a little more context (coastlines, etc) by showing the area bounded by [34, 36] N latitude and [30.5, 32.5] E longitude. Here's my code (from a Jupyter notebook):
import xarray as xr
import numpy as np
import holoviews as hv
from holoviews import opts
import geoviews as gv
import geoviews.feature as gf
from cartopy import crs as ccrs
gv.extension('matplotlib', 'bokeh')
dummy_data = np.arange(100).reshape((10, 10))
dummy_lats = np.tile(np.arange(0, 90, 9), (10, 1))
dummy_lons = np.transpose(dummy_lats)
dummy2d = xr.Dataset(data_vars={'data': (['x', 'y'], dummy_data)},
coords={'lat2d': (['x', 'y'], dummy_lats),
'lon2d': (['x', 'y'], dummy_lons)})
gf.ocean * gf.land * gv.Dataset(dummy2d.data).to(gv.QuadMesh)
I have tried:
gf.ocean * gf.land * gv.Dataset(dummy2d.data).to(gv.QuadMesh, extent=(34, 30.5, 36, 32.5))
which issues a warning WARNING:param.QuadMesh05440: Setting non-parameter attribute extent=(34, 30.5, 36, 32.5) using a mechanism intended only for parameters
without changing the plot.
I also tried
img = gf.ocean * gf.land * gv.Dataset(dummy2d.data).to(gv.QuadMesh)
img.redim.range(Latitude=(34, 36), Longitude=(30.5, 32.5))
This has no discernible effect.