Skip to content

scatterplot hover text in unexpected position #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pstoyanov opened this issue Dec 2, 2015 · 3 comments
Closed

scatterplot hover text in unexpected position #322

pstoyanov opened this issue Dec 2, 2015 · 3 comments

Comments

@pstoyanov
Copy link

[unexpected behavior]
In case there are several points with the same x coordinate, the hover text is placed at and refers to another point (sometimes the lowest, sometimes the highest, or the middle one). This also appears to happen even when the respective point is outside the currently shown region of the figure (i.e. the user has zoomed in).

For me, expected behavior is the hover text to be placed at the point under the mouse cursor.

To reproduce -- easily done in the example on the github front page (or any of the other interactive examples on the plot.ly site), zoom in until there's only one point shown, and hover over it.

Thanks for all your work!

@cpsievert
Copy link
Collaborator

I think you want layout(gg, hovermode = "closest")?

@pstoyanov
Copy link
Author

Yes, you are absolutely correct. Thank you!
Maybe this should be the default for scatterplots?

@cpsievert
Copy link
Collaborator

This is the default in plotlyjs and I think it's generally a good idea to keep consistency with defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants