I am trying to plot a Holomap from a pandas Dataframe in wide form. The dataframe has four columns; Datetime, day, V1, V2. Datetime is of the form yyyy-mm-dd hh:mm:ss at 15-minute resolution over two days. V1 and V2 contain the data. After creating the HoloMap object, I can access individual stacked Area charts but when I plot the entire object, I am getting the data for both days laid end to end, with the day selector (Holomap's kdim) only hiding the data for the day not chosen. How can get the map to show the data for only the chosen day?
import os, sys
import pandas as pd
import numpy as np
from datetime import datetime as DateTime
from holoviews import opts
import holoviews as hv
hv.extension('bokeh')
%matplotlib inline
opts.defaults(opts.Area(framewise=True))
tstamp = pd.date_range('2030-04-01',periods = 24*4*2,freq='15min')
V1 = np.random.randn(len(tstamp))
V2 = np.random.randn(len(tstamp))+5
df_in = pd.DataFrame({
'Datetime':tstamp,
'V1':V1,
'V2':V2
})
df_in['day'] = df_in.Datetime.dt.day
selected_days = df_in.day.unique()
testAreaHmap = hv.HoloMap({d: hv.Area.stack((hv.Area(df_in[df_in.day==d], label='V1',kdims=['Datetime'],vdims=['V1']).opts(color='orange')*\
hv.Area(df_in[df_in.day==d], label='V2',kdims=['Datetime'],vdims=['V2']).opts(color='blue'))) for d in selected_days}, kdims=['d'])
testAreaHmap