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

[MNT]: Unite property cycles for lines and patches #29468

Open
@timhoffm

Description

@timhoffm

Summary

Loosely insprired by#19479.

We have separate property cycles for lines and patches. This is a source of confusion and IMHO doesn't give a benefit.

Proposed fix

Unite the property cycles so that an Axes has just one cycle to draw from, no matter what the Artist is.

  • Most simple plots use only either lines or patches. They wouldn't know the difference.
  • If plots have both lines and patches, e.g. one line, one bar plot, IMHO it's more clear to by default use different colors.
  • It's quite unlikely that people implicitly rely on synced colors to intentionally have parallelism between the lines and colors.

Migration:

  • Add/document a way to get the state of the next element inthe cycle (as long as there are two, use the line cycle). This will enable explicit use of a cycle element for multiple artists like this:
    prop = ax.prop_cycle_next()ax.plot(..., color=prop['color'])ax.bar(... color=prop['color'])
  • Maybe consider ways to feed a cycle element back into a plotting function, either through an explicit kwargax.plot(..., prop=prop), or by ensuring that the cycle element can be dict-unpackedax.plot(..., **prop).
  • Minimal announce this as upcoming change in the release notes. If people are relying on parallel cycles they should move to the above pattern.
  • We could also detect when both cyclers are used and issue a warning. The downside is that people will get a warning as soon as they use a mixture of lines and patches and they may be ok with the new behavior (it's unlikely they really intend to use the old behavior).

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