Skip to content

legend_tracegroupgap doesn't work when legend_traceorder is used #3801

Open
@imirzadeh

Description

@imirzadeh

Note: to reproduce, see here

The problem

Baseline

long_df = px.data.medals_long()

fig = px.bar(long_df, x="nation", y="count", color="medal", title="Long-Form")
fig.update_layout(width=680, height=480,)
fig.show()

works just fine:
newplot (3)

Increasing the gap works

long_df = px.data.medals_long()

fig = px.bar(long_df, x="nation", y="count", color="medal", title="Long-Form")
fig.update_layout(autosize=False, width=680, height=480, legend_tracegroupgap=50)
fig.show()

also works fine
newplot (4)

Increasing the gap & reversing doesn't work

long_df = px.data.medals_long()

fig = px.bar(long_df, x="nation", y="count", color="medal", title="Long-Form Input")
fig.update_layout(width=680,height=480, legend_traceorder="reversed", legend_tracegroupgap=50)
fig.show()

gives
newplot (5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokensev-4cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions