Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bug: express bar chart with facet_col and color. It show wrong chart when clicking legend

Open
#5,387 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start by running the provided pandas and plotly.express px.bar example with facet_col="Group" and color="Category". Reproduce the legend interaction that removes Category A from Group=X, then trace the bar-chart and legend handling involved. Done means clicking a legend item preserves the expected bars in every facet without requiring the width workaround.

Written by the indexing model from the issue text.

Description

Example:

import pandas as pd
import plotly.express as px
data = {
'Category': ['A', 'B', 'A', 'A', 'B', 'A'],
'Date': ['2025-10-11', '2025-10-11', '2025-10-12', '2025-10-13', '2025-10-13', '2025-10-13'],
'Value': [10, 15, 12, 8, 20, 5],
'Group': ['X', 'X', 'Y', 'Y', 'X', 'Y']
}
df = pd.DataFrame(data)
fig = px.bar(df, x='Date', y='Value',color='Category', facet_col="Group")
fig.show()
Image
When click legend Category B to keep Category A only. It's gone for Group=X

Image

Workaround
for trace in fig.data:
trace.width=8200000

Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
13h 41m
Merged PRs (30d)
21

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.

More from plotly/plotly.py

All issues in plotly/plotly.py

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.