hover vline misaligned between two lines

I have two sets of Y data using the exact same X data.

I have a hovertool in “vline” mode and “nearest” line_policy. It should give the same X value and the same index value for both lines.

I attached two pictures to illustrate this.

On the first picture the index is off by 1 unit and we can see the box is not attached on the same point for the blue line.

On the second picture, I zoomed in, the hover works better.

Hi,

I have two sets of Y data using the exact same X data.

I have a hovertool in "vline" mode and "nearest" line_policy. It should give the same X value and the same index value for both lines.

With "nearest", I don't think this is true in general. The "nearest" policy means just that, use the nearest point on the line (to the point of intersection) for the inspection. If two different lines have different derivatives, then for a given x position, it is entirely possible for the nearest point on one line is the "previous" point and the nearest point on the other line is the "next" point. I suspect that is what is occurring here. The "prev" or "next" policies would probably provide more "predictable" behavior in these instances.

Thanks,

Bryan

···

I attached two pictures to illustrate this.

On the first picture the index is off by 1 unit and we can see the box is not attached on the same point for the blue line.
On the second picture, I zoomed in, the hover works better.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/98ab2923-9a69-46c8-a0fa-e1f1172de741%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
<hover_vline2.PNG><hover_vline3.PNG>

I just tried and indeed I do not see any offset with the line_policy set to ‘prev’ or ‘next’

Thank you !