Skip to content

No error message in matplotlib.axes.Axes.legend() if there are more labels than handles #24050

@haferburg

Description

@haferburg

I had a bug in my code where I called plot() six times, stored the handles in a list, then called legend() with six handles, but seven labels for the legend.

It would have been very helpful if matplotlib raised an exception in this case.

matplotlib.__version__ is 3.6.0, Python 3.9.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: argument checkingDifficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!topic: legend

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy