Hello,
Suppose I have the following code which creates a holomap of sine curves parameterized by t
.
import holoviews as hv
hv.notebook_extension('bokeh')
import numpy as np
def sine_curve(t=0):
x = np.arange(0,10)
y = np.sin(x - t)
return hv.Curve((x, y))
t_arr = np.linspace(0, 10, 11)
curve_dict = {t: sine_curve(t) for t in t_arr}
hv.HoloMap(curve_dict, kdims=["time"])
A sample output looks like this
The nice thing is that the title changes with the sliding button so it is clear to the reader. What I wanted to do is display extra information that depends on
t
. For example, I have another quantity calculated by
def temperatrue(t):
return 30 + t
and I want the title to be customized to “time: 1, temperature 31”, where the 31 is obtained by dynamically calling temperature
with t
for each plot. How can I do that?
Alternatively, I can overlay an hv.Text(4,0,str(temperatrue(t)))
onto the plot. But how can I hold the text in a fixed position so panning won’t affect it?
Thank you!