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

[Bug]: y_label in wrong place after clearing for twinx axes #28268

@katetsisar

Description

@katetsisar

Bug summary

After making sexond axes on the righr with twinx y_label for this second axes is on the right, but clearing(doesn't matter is it cla() or clear()) second axes breaks set_ylabel putting it on the left. Ticks for second axes are still on the right, so I don't see why y_label wouldn't also go there(thats why I think its a bug)

Code for reproduction

importmatplotlibimportmatplotlib.pyplotaspltfigure=plt.figure()ax=figure.add_subplot(111)ax2=ax.twinx()ax2.cla()#or clear() ; doesn't work both waysax.set_ylabel('ax_label')ax2.set_ylabel('ax2_label')#expected to be on the rightplt.show()

Actual outcome

image

Expected outcome

after clearing ax2 is still on the right, I expected its label also to be on the right
image

Additional information

I saw that similar solved problems occurred with twinx()(it was something to do with mirroring), but I couldn't find solution for this specific situation

Operating system

No response

Matplotlib Version

3.7.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp