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

Feature Idea: Make subplots return an AxisList object instead of a numpy array #9434

Closed as not planned
Labels
DocumentationNew featurestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action
@AKuederle

Description

@AKuederle

Hey,

This is a short idea I had when creating complex graphs with multiple subplots.
Sometimes you want to apply the same actions to multiple subplots and a way that feels very natural would be something like this:

fig,axs=plt.subplots(2,2)axs[:,0].set_ylabel('test')

This does of course not work, but could be easily be achieved by returning a custom object that wraps a list of axes instances and overwrites the__getitem__ method.
Of course it would need to reimplement all axes methods, but it might be possible to do that by just forwarding all call in a modified__getattribute__ or by automatically creating wrapped classmethods in a metaclass.

With such a custom object it might even be possible to support something like this:

axs[:,0].set_ylabel(['test1','test2'])

If there is interest in such functionality, I would try to build a working prototype.

Other than that, thanks to everybody for all the awesome work you put into matplotlib!
Regards,
Arne

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationNew featurestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    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