plotly / plotly/plotly.py

"x unified" Does not show all data info at same X

Open
#3,606 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Environment:

Python 3.9.5
plotly.py v5.6.0
VS Code Jupyter Environment

How it is now

fig = px.scatter(result_df, x=[1, 2, 2, 3], y=[1, 2, 3, 4])
fig.update_traces(mode="markers", hovertemplate=None)
fig.update_layout(hovermode="x unified")
fig.show()
image As shown above, the hover box only displayed 1 y-axis value.

How it should be

image

The hover box should display all y-axis values at the same X, even if they are the same type, in my example scatter plot.
As demonstrated in the document, plotly has the capability to show all values at the same X. But unfortunately it only works when there are another data dimension involved.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Python reproduction using px.scatter, update_traces, and hovermode="x unified", then compare its behavior with the linked hover-text documentation. Investigate why repeated points at the same X produce only one Y value in the hover box. Done means the hover box displays every Y-axis value at that X for the example case.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.