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]: set_position for tick labels don't work #30056

Closed as not planned
Closed as not planned
@AntonyCotton

Description

@AntonyCotton

Bug summary

Sometimes, the axis tick labels overlaps. In such cases, manually adjusting their positions slightly is one solution. However, I found that this doesn't seem to work.

Here is a simple example. I simulated a situation where the text would overlap by setting a smaller figure size.

importmatplotlib.pyplotaspltfig=plt.figure(figsize=(0.2,0.2))ax=fig.subplots(1,1)ax.plot(range(10),range(10))plt.show()

As it can be seen, the y-axis labels '0' and '5' have some overlap.

Image

Then, I obtained the y-axis tick label objects usingget_yticklabels and tried to raise the position of '5' usingset_position. As shown below, nothing changed.

Code for reproduction

importmatplotlib.pyplotaspltfig=plt.figure(figsize=(0.2,0.2))ax=fig.subplots(1,1)ax.plot(range(10),range(10))texts=ax.get_yticklabels()fortextintexts:iftext.get_text()=="5":text.set_position((0,6))plt.show()

Actual outcome

Image

Expected outcome

The position of '5' on the y-axis should be adjusted upwards.

Additional information

No response

Operating system

Debian

Matplotlib Version

3.10.1

Matplotlib Backend

module://matplotlib_inline.backend_inline

Python version

3.13.2

Jupyter version

4.4.0

Installation

pip

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp