☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

hover vline misaligned between two lines

Community Support
Sebastien_Roche
Sebastien_Roche

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.

⌁   Link to post
Bryan
Bryan

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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
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>

⌁   Link to post

End of archived discussion · Replies are disabled