8000 Bug with matplotlib 3.10.0 · Issue #289 · jnothman/UpSetPlot · GitHub
[go: up one dir, main page]

Skip to content

Bug with matplotlib 3.10.0 #289

Open

Description

@durr1602

Hi,
I've noticed a bug related to one of the recent versions of matplotlib (at the time of writing). The error is raised when I draw the upsetplot using this line:
d = upset_obj.plot(fig=fig)
I've traced it back to the "legend.py" script of matplotlib 3.10.0, in which the following lines cause the issue:

    labels = [*reversed(labels)]
    handles = [*reversed(handles)]
if len(handles) < 2:

TypeError: object of type 'list_reverseiterator' has no len()

The issue is not present in matplotlib v3.9.2 since legend.py did not feature these lines.
Help much appreciated!

Activity

  1. RicYaben commented on Feb 3, 2025

    @RicYaben

    Hey there! I encountered this issue and fixed it in this fork. Here is the only thing I changed: https://github.com/RicYaben/UpSetPlot/blob/bceb91d7655dd30a189eb58823c9b301a174f35b/upsetplot/plotting.py#L535

    ax.legend(list(reversed(handles)), list(reversed(labels)))
    
  2. added a commit that references this issue on Jun 10, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0