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

[ENH]: set_horizontalalignment("right") on Y axis labels when yaxis.ticks_right() is used. #21566

Closed
Milestone
@cmaydew

Description

@cmaydew

Problem

I have a subplot where the y axis labels need to be on the right side, however doing so results in left alignment of the labels. Setting them to right aligned puts them on top of the axis (as they are right aligned from the left edge of where they were left aligned). Of course setting a pad is an option, but that isn't dynamic to the labels. If I make a dozen graphs, they have a different number of digits, so the pad would need to be dynamic to that (and without using a monospaced font and counting the number of digits).

Proposed solution

I have made a way to make the dynamic padding, but it would likely need refinement before implementing.Here is a stack overflow question where I posted my method for right aligning and padding based on the width of the widest label. Even though I do have this current method, I'm submitting as a feature request since I haven't contributed to matplotlib before, and to allow for another solution that may be more refined.

Additional context and prior art

No response

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