Skip to content

[MNT]: matplotlib.cycler and pyplot.cycler are different functions #26868

Open
@timhoffm

Description

@timhoffm

Summary

  • pyplot.cycler is an (unused) import of the original cycler.cycler() function. This was originally imported in 0c1e609 to be used inside the xkcd() function. It's probably not meant to be public, but as a matter of fact is now (https://github.com/search?q=plt.cycler&type=code). - We even have used it in an example in 3.4.0 What's new.
  • matplotlib.cycler is matplotlib.rcsetup.cycler() which is a wrapper around cycler.cycler() and additionally includes validation.

Proposed fix

Attention @ksunden: pyplot.cycler is not re-exported for typing, so we may see complaints about this in the near future.


Generally, we should not expose two different cycler functions within matplotlib. It's questionable enough (though one can argue for it) that we provide a replacement for the original cycler.

Likely, the reasonable way forward is to expose matplotlib.rcsetup.cycler() in pyplot.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions