Title: Toggling visibility of axis tick labels causes their destruction · Issue #16197 · matplotlib/matplotlib · GitHub
Open Graph Title: Toggling visibility of axis tick labels causes their destruction · Issue #16197 · matplotlib/matplotlib
X Title: Toggling visibility of axis tick labels causes their destruction · Issue #16197 · matplotlib/matplotlib
Description: Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, see here. According to @ImportanceOfBeingErnest, this issue is related to #10088. I include a minimal code fragment that demon...
Open Graph Description: Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, see here. According to @ImportanceOfBeingErnest, this issue is related to #10088. I in...
X Description: Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, see here. According to @ImportanceOfBeingErnest, this issue is related to #10088. I in...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/16197
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Toggling visibility of axis tick labels causes their destruction","articleBody":"Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, see [here](https://stackoverflow.com/questions/59692367/toggling-visibility-of-axis-tick-labels-causes-them-to-be-destructed-altogether?noredirect=1#comment105547430_59692367). According to @ImportanceOfBeingErnest, this issue is related to [#10088](https://github.com/matplotlib/matplotlib/pull/10088).\r\n\r\nI include a minimal code fragment that demonstrates the problem.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nfrom matplotlib import pyplot as plt\r\nplt.plot([0, 1], [8, 6])\r\nax = plt.gca()\r\nyticks = ax.get_yticklabels()\r\nprint(yticks)\r\nfor tick in yticks:\r\n tick.set_visible(False)\r\n\r\nprint(ax.get_yticklabels())\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\n\u003ca list of 11 Text yticklabel objects\u003e\r\n\u003ca list of 0 Text yticklabel objects\u003e\r\n```\r\n\r\n**Expected outcome**\r\n\r\nThe snippet shows that the y tick labels are destructed after setting their visibility to False. One can restore them by issuing:\r\n```\r\nax.yaxis.set_tick_params(labelleft=True)\r\n```\r\nThis issue first occurred on matplotlib 3.1.2 but not on the previous version (which I believe was 3.0.x).\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Win10 Pro 64bit\r\n * Matplotlib version: 3.1.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.6.3\r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\nPython was installed via WinPython; Matplotlib was manually upgraded to v3.1.2.\r\n","author":{"url":"https://github.com/TheAngulion","@type":"Person","name":"TheAngulion"},"datePublished":"2020-01-12T17:35:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/16197/matplotlib/issues/16197"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6c74ec6c-3313-fe82-f174-076503a4f0da |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA88:2CE7AA:244FEAA:30B8061:6A5473A1 |
| html-safe-nonce | 2752bd11f30289ec8ed94afef2af3059c600a6f09463c1e98f7fc675f3ead718 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTg4OjJDRTdBQToyNDRGRUFBOjMwQjgwNjE6NkE1NDczQTEiLCJ2aXNpdG9yX2lkIjoiODE4NDk1MzM2MTQxNTgyODM4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6f81aba41403f0635205ac552f47a6f6806800bcbcb220daa93f45deb4c61139 |
| hovercard-subject-tag | issue:548601821 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/16197/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1adc1f0eef26a54d1f93c70e30d6370d676fdafd40821697e2fae12ced2f549d/matplotlib/matplotlib/issues/16197 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1adc1f0eef26a54d1f93c70e30d6370d676fdafd40821697e2fae12ced2f549d/matplotlib/matplotlib/issues/16197 |
| og:image:alt | Toggling the visibility of the axis tick labels via set_visible(False) can lead to their outright destruction, see here. According to @ImportanceOfBeingErnest, this issue is related to #10088. I in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TheAngulion |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width