OK, here’s a piece of self-contained code that reproduces the problem (bottom plot in the figure on my original message):
import numpy as np
import holoviews as hv
from holoviews import opts
import pandas as pd
import xarray as xr
import datetime as dt
hv.extension('bokeh')
# temporal parameters
idate = dt.datetime(2018,12,10)
startdate = idate - dt.timedelta(days=5)
enddate = idate + dt.timedelta(days=5)
# spatial parameters
region = {'name':'EBUS_region','lonmin':-30 ,'lonmax':-15, 'latmin':15,'latmax':25}
# Read chl data
# open dataset
GEO_DAILY_THREDDS_string = 'https://rsg.pml.ac.uk/thredds/dodsC/CCI_ALL-v5.0-DAILY'
all_data = xr.open_dataset(GEO_DAILY_THREDDS_string)
# read subsetted data
ds_CHL = all_data['chlor_a'].loc[ { 'time': slice("2018-12-05", "2018-12-15"),
'lat': slice(region['latmax'], region['latmin']),
'lon': slice(region['lonmin'], region['lonmax'])} ]
# these are the parts of the olt dataset
trajlat = np.asarray([22.56054 , 22.759396, 22.491493, 22.1794 , 22.900251, 22.740063,
22.6793 , 22.40035 , 22.770443, 22.474922, 22.513588, 22.320257,
23.06044 , 22.579874, 22.378256, 22.317495, 22.458351, 22.613016,
22.33959 , 22.10483 , 22.886442, 22.731777, 22.58816 , 22.284351,
22.856062, 22.582636, 22.450066, 22.276066, 23.077013, 22.715206,
22.48597 , 22.405874, 22.367208, 22.452827, 22.220829, 22.060638,
22.803585, 22.673777, 22.488731, 22.229115, 22.903013, 22.676538,
22.447304, 22.303684, 23.079775, 22.828444, 22.60473 , 22.508064,
22.28159 , 22.300922, 22.13521 , 22.049591, 22.676538, 22.566065,
22.411398, 22.231876, 22.869871, 22.712444, 22.491493, 22.358923,
23.04663 , 22.922346, 22.731777, 22.640635, 22.198734, 22.187685,
22.107592, 22.085497, 22.510826, 22.458351, 22.372732, 22.295399,
22.767681, 22.698635, 22.552254, 22.480446, 22.974823, 22.930632,
22.842253, 22.762157, 22.124163, 22.124163, 22.124163, 22.124163,
22.375494, 22.375494, 22.375494, 22.375494, 22.624063, 22.624063,
22.624063, 22.624063, 22.875395, 22.875395, 22.875395, 22.875395,
22.055115, 22.143496, 22.187685, 22.124163, 22.245686, 22.347876,
22.477684, 22.483208, 22.510826, 22.530159, 22.615778, 22.715206,
22.762157, 22.773205, 22.833967, 22.91406 , 22.030258, 22.184923,
22.245686, 22.126925, 22.171114, 22.364447, 22.58816 , 22.593683,
22.397589, 22.43073 , 22.596445, 22.792538, 22.651682, 22.657206,
22.740063, 22.903013, 22.068926, 22.234638, 22.284351, 22.126925,
22.168352, 22.411398, 22.657206, 22.687586, 22.295399, 22.356161,
22.54673 , 22.789776, 22.555016, 22.524635, 22.624063, 22.83673 ,
22.085497, 22.287113, 22.320257, 22.124163, 22.212543, 22.483208,
22.676538, 22.76492 , 22.218067, 22.323019, 22.488731, 22.7373 ,
22.461113, 22.422445, 22.508064, 22.740063, 22.077211, 22.32578 ,
22.356161, 22.115877, 22.248447, 22.549492, 22.657206, 22.784252,
22.190449, 22.347876, 22.444542, 22.659967, 22.378256, 22.334066,
22.40035 , 22.637873])
trajlon = np.asarray([-19.862196, -19.619822, -19.77957 , -19.7355 , -19.118547,
-19.168125, -19.36643 , -19.614313, -18.870665, -19.068972,
-19.377447, -19.438042, -18.8927 , -18.743969, -18.826597,
-18.743969, -19.939316, -19.746517, -19.801603, -19.652874,
-19.355413, -19.327871, -19.471092, -19.548212, -19.024904,
-19.085497, -19.382957, -19.349905, -19.046938, -18.832106,
-18.85414 , -18.766005, -19.977875, -19.81262 , -19.763044,
-19.52067 , -19.581263, -19.4766 , -19.52067 , -19.449059,
-19.245243, -19.173634, -19.33338 , -19.228718, -19.228718,
-18.958801, -18.909225, -18.810072, -19.983383, -19.807112,
-19.674908, -19.388466, -19.752026, -19.59228 , -19.504143,
-19.327871, -19.498634, -19.311346, -19.29482 , -19.135075,
-19.438042, -19.1516 , -18.99736 , -18.881683, -19.950333,
-19.741009, -19.526178, -19.245243, -19.856688, -19.641857,
-19.449059, -19.206684, -19.718975, -19.4766 , -19.305838,
-19.091005, -19.658382, -19.377447, -19.1516 , -18.975327,
-19.848425, -19.600542, -19.377449, -19.1516 , -19.840162,
-19.592281, -19.380203, -19.154354, -19.842916, -19.597788,
-19.396729, -19.162617, -19.859444, -19.608805, -19.385712,
-19.154354, -19.746517, -19.460075, -19.228718, -19.057955,
-19.823637, -19.542704, -19.311346, -19.102022, -19.966858,
-19.718975, -19.487617, -19.234226, -20.060503, -19.840162,
-19.619822, -19.33338 , -19.608805, -19.316854, -19.140583,
-19.013887, -19.718975, -19.454567, -19.338888, -19.140583,
-19.9944 , -19.746517, -19.597788, -19.388466, -20.209232,
-19.999908, -19.823637, -19.564737, -19.438042, -19.212193,
-19.102022, -18.980835, -19.575754, -19.393974, -19.44355 ,
-19.228718, -19.966858, -19.707958, -19.691433, -19.59228 ,
-20.33042 , -20.110079, -19.983383, -19.807112, -19.311346,
-19.146091, -19.079988, -18.96431 , -19.432533, -19.36643 ,
-19.581263, -19.360922, -19.895248, -19.647366, -19.746517,
-19.790586, -20.396523, -20.14864 , -20.077028, -20.010927,
-19.212193, -19.113039, -19.068972, -18.947784, -19.33338 ,
-19.399483, -19.724483, -19.531687, -19.790586, -19.559229,
-19.763044, -19.955841, -20.40754 , -20.132114, -20.10457 ,
-20.176182])
t64 = np.asarray(['2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-05T00:00:00.000000000', '2018-12-05T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-06T00:00:00.000000000', '2018-12-06T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-07T00:00:00.000000000', '2018-12-07T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-08T00:00:00.000000000', '2018-12-08T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-09T00:00:00.000000000', '2018-12-09T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-10T00:00:00.000000000', '2018-12-10T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-11T00:00:00.000000000', '2018-12-11T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-12T00:00:00.000000000', '2018-12-12T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-13T00:00:00.000000000', '2018-12-13T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-14T00:00:00.000000000', '2018-12-14T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000',
'2018-12-15T00:00:00.000000000', '2018-12-15T00:00:00.000000000'],
dtype='datetime64[ns]')
# combine the parts into a pandas dataframe
tt = pd.DataFrame({"lat" : np.ravel(trajlat),
"lon" : np.ravel(trajlon),
"time": np.ravel(t64)
})
# create holoviews object for olt
hv_olt = hv.Dataset(tt)
olt = hv_olt.to(hv.Points,
kdims = ["lon", "lat"],
).redim.range(lon = (-25, -16),
lat = ( 18, 24),
)
olt.opts(color = 'r', marker='o', size=5, fill_alpha = 0)
# create holoviews object for chl
hv_chl = hv.Dataset(ds_CHL.sel(time = slice(startdate, enddate)))
chl = hv_chl.to(hv.Image,
kdims = ["lon", "lat"],
vdims = ["chlor_a"],
dynamic = False,
).redim.range(lon = (-25, -16),
lat = ( 18, 24),
chlor_a = (0.02, 7),
)
chl.opts(colorbar = True,
cmap = 'viridis',
logz = True,
)
overlay = chl + olt
overlay.opts( width = 800,
height = 300)