Only a single hover box shown for overlapping/multiple points
See original GitHub issueThis 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:
With hvPlot:
df.hvplot(kind="scatter",
x="sepal_length", y="sepal_width", by="species",
hover_cols=["petal_length", "petal_width"],
alpha=0.4)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 😃
It would be great to add this feature