Visitar URL original
Use ticklabels([]) instead of ticklabels('') by timhoffm · Pull Request #20632 · matplotlib/matplotlib · GitHub
The Wayback Machine - https://web.archive.org/web/20210712223906/https://github.com/matplotlib/matplotlib/pull/20632
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ticklabels([]) instead of ticklabels('') #20632

Merged
merged 1 commit into from Jul 12, 2021

Conversation

@timhoffm
Copy link
Member

@timhoffm timhoffm commented Jul 11, 2021

The string variant is not supported according to the docstring. It's
only working by accident due to the list comprehension in

ticklabels = [t.get_text() if hasattr(t, 'get_text') else t

@timhoffm
Copy link
Member Author

@timhoffm timhoffm commented Jul 11, 2021

Technically not a doc-only change because I also updated the tests.

@timhoffm timhoffm added this to the v3.5.0 milestone Jul 11, 2021
@timhoffm timhoffm force-pushed the timhoffm:ticklabels-empty-str branch from 9137f20 to 5604fcc Jul 11, 2021
@@ -68,8 +68,8 @@ def doall():
plt.gca().set_ylim(0., 1.)
plt.gca().set_title("Matplotlib's math rendering engine",
color=mpl_grey_rvb, fontsize=14, weight='bold')
plt.gca().set_xticklabels("", visible=False)
plt.gca().set_yticklabels("", visible=False)

This comment has been minimized.

@story645

story645 Jul 12, 2021
Member

What is visible=False doing here?/is it okay that it's dropped?

This comment has been minimized.

@timhoffm

timhoffm Jul 12, 2021 •
Author Member

It sets all of the 0 created ticklabels to invisible 🙃 , i.e. does nothing.

The string variant is not supported according to the docstring. It's
only working by accident.
@timhoffm timhoffm force-pushed the timhoffm:ticklabels-empty-str branch from 5604fcc to e0ddd9b Jul 12, 2021
@timhoffm timhoffm merged commit 14b34fd into matplotlib:master Jul 12, 2021
26 checks passed
26 checks passed
@github-actions
flake8
Details
@github-actions
greeting
Details
@github-actions
Python 3.7 on ubuntu-18.04 (Minimum Versions)
Details
@github-actions
Python 3.7 on ubuntu-18.04
Details
@github-actions
Python 3.8 on ubuntu-18.04
Details
@github-actions
Python 3.9 on ubuntu-20.04
Details
@github-actions
Python 3.8 on macos-latest
Details
@github-actions
eslint
Details
@lgtm-com
LGTM analysis: JavaScript No code changes detected
Details
@lgtm-com
LGTM analysis: Python No new or fixed alerts
Details
ci/circleci: docs-python38 Your tests passed on CircleCI!
Details
@github-actions
ci/circleci: docs-python38 artifact Link to 0/doc/build/html/index.html
Details
@codecov
codecov/patch 100.00% of diff hit (target 50.00%)
Details
@codecov
codecov/project/library 80.40% (target 50.00%)
Details
@codecov
codecov/project/tests 98.97% (+0.00%) compared to 30cbdf7
Details
@appveyor
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@azure-pipelines
matplotlib.matplotlib Build #20210712.2 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job Linux_py37) Job Linux_py37 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job Linux_py38) Job Linux_py38 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job Linux_py39) Job Linux_py39 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job Windows_py37) Job Windows_py37 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job Windows_py38) Job Windows_py38 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job Windows_py39) Job Windows_py39 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job macOS_py37) Job macOS_py37 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job macOS_py38) Job macOS_py38 succeeded
Details
@azure-pipelines
matplotlib.matplotlib (Job macOS_py39) Job macOS_py39 succeeded
Details
@timhoffm
Copy link
Member Author

@timhoffm timhoffm commented Jul 12, 2021

Self-merged based on the positive review.

@timhoffm timhoffm deleted the timhoffm:ticklabels-empty-str branch Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants