Dear all,
I’ve encountered an issue when plotting global gridded data with hvPlot using a Cartopy projection:
When I use the PlateCarree projection, longitude and latitude ticks do appear correctly.
However, when I switch to SouthPolarStereo, all the ticks disappear — even though the data and code are otherwise identical.
Here is a minimal reproducible example:
import xarray as xr
import hvplot.xarray
import cartopy.crs as ccrs
import geoviews as gv
# Dummy data (you can use any global dataset)
lat = xr.DataArray(range(-90, -30), dims='latitude')
lon = xr.DataArray(range(-180, 181), dims='longitude')
data = xr.DataArray(
lat**2 + lon**2,
dims=('latitude', 'longitude'),
coords={'latitude': lat, 'longitude': lon},
)
# --- Works fine: ticks visible ---
mld = data.hvplot.quadmesh(
x='longitude', y='latitude',
geo=True, coastline=True,
projection=ccrs.PlateCarree(),
cmap='YlGnBu', xlabel='Longitude', ylabel='Latitude'
)
(mld * gv.feature.grid()).opts(show_grid=False)
# --- Problem: no ticks ---
mld = data.hvplot.quadmesh(
x='longitude', y='latitude',
geo=True, coastline=True,
projection=ccrs.SouthPolarStereo(),
cmap='YlGnBu',
xlabel='Longitude', ylabel='Latitude'
)
(mld * gv.feature.grid()).opts(show_grid=False)
hvplotversion: 0.12.1geoviewsversion: 1.14.1cartopyversion: 0.25.0