plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

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

Open pondhsiao opened this issue 2 months ago • 0 comments

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

pondhsiao avatar Oct 31 '25 01:10 pondhsiao