Skip to content

Support sharing cycler instances across axes #19479

Open
@anntzer

Description

@anntzer

Problem

It would be useful to be able to share a single cycler instance across multiple axes, so that plotting on one axes advances the same instance on all of them.

Proposed Solution

cycler = <some cycler instance>
ax1.set_prop_cycle(cycler)
ax2.set_prop_cycle(cycler)

should use the same cycler instance. Alternatively, if this is deemed unacceptable due to backcompat breakage (even though I believe this can get a proper deprecation warning), one should at least be able to do e.g.

cycler = <some cycler instance>
it = iter(cycler)  # or it = cycler.iter(), or whatnot
ax1.set_prop_cycle(it)
ax2.set_prop_cycle(it)

which has no backcompat concerns as set_prop_cycle(single_arg) currently requires single_arg to be exactly a Cycler instance.

Additional context and prior art

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