Skip to content

Broken filled area plot after interaction #2942

Description

@Peque

This code gives us a beautiful plot:

import plotly.graph_objects as go

trace0 = dict(
    x=list(range(24)),
    y=[163, 154, 114, 61, 32, 19, 20, 20, 26, 38, 67, 102, 132, 159],
    name="Two",
    fill='tozeroy',
    stackgroup="one",
)
trace1 = dict(
    x=list(range(24)),
    y=[0, 8, 51, 108, 143, 164, 166, 168, 165, 152, 126, 80, 40, 11],
    name="Three",
    fill='tonexty',
    stackgroup="one",
)
trace2 = dict(
    x=list(range(24)),
    y=[0, 0, 0, 4, 19, 37, 49, 49, 39, 25, 7, 1, 0, 0],
    name="One",
    fill='tonexty',
    stackgroup="one",
)
data = [trace0, trace1, trace2]
go.Figure(data=data)

However, if we click on the legend in the following exact order [One, Two, Three, One, Two, Three], it breaks:

plotlybug

Activity

  1. sorenwacker commented on Mar 8, 2022

    @sorenwacker

    Same problem. After switching all traces off and on again the area plot looks like this:
    image

    The order of switching on and off matters.

    Using plotly 5.6.0

  2. self-assigned this
    on Jul 3, 2024
  3. removed their assignment
    on Aug 2, 2024
  4. emilykl commented on Aug 31, 2026

    @emilykl
    Contributor

    I believe this bug was fixed by plotly/plotly.js#7668 and first released in plotly.py v6.6.0. Let us know if you still see this issue in the latest plotly versions.

  5. Peque commented on Sep 3, 2026

    @Peque
    Author

    @emilykl Yeah, it seems this is now fixed. Thanks! 😊

  6. emilykl commented on Sep 3, 2026

    @emilykl
    Contributor

    @Peque Awesome, thanks for the confirmation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions