我希望能够基于 kdim 的变量名称以编程方式更改 DynamicMap 的范围。例如:
frequencies = [0.5, 0.75, 1.0, 1.25]
def sine_curve(phase, freq):
xvals = [0.1* i for i in range(100)]
return hv.Curve((xvals, [np.sin(phase+freq*x) for x in xvals]))
dmap = hv.DynamicMap(sine_curve, kdims=['phase', 'frequency'])
dmap.redim.range(phase=(0.5,1)).redim.range(frequency=(0.5,1.25))
我想做这样的事情:
label = 'frequency'
dmap = hv.DynamicMap(sine_curve, kdims=['phase', label])
dmap.redim.range(phase=(0.5,1)).redim.range(label=(0.5,1.25))
有没有合适的方法来做到这一点?