0

Have the following code to test out reference line:

import holoviews as hv
from holoviews import dim, opts

hv.extension('bokeh', 'matplotlib')
hv.output(size=300)


testMap = hv.HoloMap({i: hv.Curve([1, 2+i, 3,4-i,5,6+i,7,8-i,9,10+i], group='Environment', label='Smooth') for i in range(10)}, 'Threshold')


rLine = hv.HLine(0.5, label="rLine")
testMap * rLine

testMap.opts(
    opts.Curve(color='#dac8e4', line_width=5))



renderer = hv.renderer('bokeh')
# Using renderer save
renderer.save(testMap, 'sampleSlider')

The plot and slider work fine, it's just the HLine is not showing up at all. I played around with a bunch of its settings, tried hv.help, but it's not showing up. No errors either.

What am I doing wrong?

Thanks.

Tester_Y
  • 367
  • 4
  • 18

1 Answers1

1

By default annotations, such as HLine and VLine, are not included in the range computation. Starting in the next version of HoloViews 1.12.4 you will be able to include them by using hv.HLine(0.5, label="rLine").opts(apply_ranges=True). For now you will have to manually set the y-axis limits to ensure the HLine is visible:

testMap.opts(
    opts.Curve(color='#dac8e4', line_width=5, ylim=(0, None)))
philippjfr
  • 3,997
  • 14
  • 15