question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only a single hover box shown for overlapping/multiple points

See original GitHub issue

This has been tested in version 4.7.1.

When hover information is shown for points e.g. in a scatter plot, the following situations can occur:

  • there are multiple points on exactly the same coordinates
  • there are multiple points close to the same coordinates and the markers used to visualize those points overlap in the graph

Hover information for all those multiple points should be shown, especially in cases where the hover information includes additional data not shown directly in the graph.

The hvPlot library does this correctly: it shows stacked hover boxes for all the data points under the cursor. Plotly only shows one hover box and it is not clear which one.

I think this is an actual bug since it makes it easy to miss data and the hover information does not represent the actual data in the graph.

Here is an example using the Iris data set and Plotly:

import plotly.express as px
from bokeh.sampledata import iris
df = iris.flowers.copy()
fig = px.scatter(df, x="sepal_length", y="sepal_width", color="species",
                 opacity=0.4, hover_data=["petal_length", "petal_width"]
                )
fig.show()

This shows: plotly01

With hvPlot:

df.hvplot(kind="scatter", 
          x="sepal_length", y="sepal_width", by="species", 
          hover_cols=["petal_length", "petal_width"], 
          alpha=0.4)

Hvplot01

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
nicolaskruchtencommented, May 17, 2020

I agree that we should have an additional hover mode for this behaviour but the current behaviour is not considered a bug at this time 😃

2reactions
BeanRepocommented, Feb 8, 2022

It would be great to add this feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hover information for overlapping or identical data points
But Plotly will only show the hover box for one of the overlapping or identical points. Is there a way to change the...
Read more >
Viewing hover info for overlapping scatter points in Plotly R
The issue I have is that when two or more scatter points overlap (i.e. same x and y), the hover information only shows...
Read more >
Show, Hide, and Format Mark Labels
Rather than showing all mark labels or dynamically showing labels based on the view, you might want to show labels for only individual...
Read more >
plotly.express.box — 5.11.0 documentation
plotly.express. box (data_frame=None, x=None, y=None, color=None, ... If 'outliers' , only the sample points lying outside the whiskers are shown.
Read more >
Line Chart
Displays tooltips when hovering over points. ... The appearance and interactivity are largely final, but many of the ... Thickness of the box...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found