I want to draw a plot that has both curves based on (x, y) data and horizontal lines. I want to update the curves and lines based on the state of a slider. How can I do this?
I know how to update the curve based on the slider state, by using ColumnDataSource
. I also know how to draw a horizontal line, by using Span
. But I don't know how to combine these two.
For now, I am doing a hack by representing the horizontal line by an array of identical y-values, which I am storing in the ColumnDataSource
, and by using line()
instead of Span
. I'm just wondering if this is the intended way to solve this problem.
I found this same question asked by user Thornhale in a 2017 comment to this answer. But the comment was not answered.