-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Workaround
for trace in fig.data:
trace.width=8200000
Metadata
Metadata
Assignees
Labels
No labels