Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

More strict handling of legend(labels) #18107

Open
@timhoffm

Description

@timhoffm

We already discouragelegend(labels) in the docs:

Note: This way of using is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.

Additionally, this API is very permissive:

  • If there are less labels than artists, only the firstlen(labels) artists are labelled.
  • If there are more labels than artists, additional labels are silently ignored.

IMHO this length adaption is very prone to hiding errors.

Possible options if the number of labels does not match the number of available handles:

  1. Emit a warning.
  2. Deprecate the length adaption and error out in the future.
  3. Deprecate the wholelegend(labels) API, because it's prone to misuse anyway. (This would us also enable in the long run to migrate to an explicitlegend(handles=None, labels=None, **kwargs) signature instead oflegend(*args, **kwargs).)

I tend to go with option 2. Comments are welcome.

Inspired by#18096.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp