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

Toggling visibility of axis tick labels causes their destruction #16197

Open
@TheAngulion

Description

@TheAngulion

Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, seehere. According to@ImportanceOfBeingErnest, this issue is related to#10088.

I include a minimal code fragment that demonstrates the problem.

Code for reproduction

frommatplotlibimportpyplotaspltplt.plot([0,1], [8,6])ax=plt.gca()yticks=ax.get_yticklabels()print(yticks)fortickinyticks:tick.set_visible(False)print(ax.get_yticklabels())

Actual outcome

<a list of 11 Text yticklabel objects><a list of 0 Text yticklabel objects>

Expected outcome

The snippet shows that the y tick labels are destructed after setting their visibility to False. One can restore them by issuing:

ax.yaxis.set_tick_params(labelleft=True)

This issue first occurred on matplotlib 3.1.2 but not on the previous version (which I believe was 3.0.x).

Matplotlib version

  • Operating system: Win10 Pro 64bit
  • Matplotlib version: 3.1.2
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.6.3

Python was installed via WinPython; Matplotlib was manually upgraded to v3.1.2.

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