Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
@pondhsiao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /