Title: [Doc]: Provide a working example for turning on specific axes labels when sharex or sharey are used with subplots · Issue #24958 · matplotlib/matplotlib · GitHub
Open Graph Title: [Doc]: Provide a working example for turning on specific axes labels when sharex or sharey are used with subplots · Issue #24958 · matplotlib/matplotlib
X Title: [Doc]: Provide a working example for turning on specific axes labels when sharex or sharey are used with subplots · Issue #24958 · matplotlib/matplotlib
Description: Documentation Link https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.subplots.html Problem I find the feature to turn off the labels for all the subplots with a shared axis that are not in the edge of the subplots' grid surprisi...
Open Graph Description: Documentation Link https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.subplots.html Problem I find the feature to turn off the labels for all the subplots with a shared axis that are not in...
X Description: Documentation Link https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.subplots.html Problem I find the feature to turn off the labels for all the subplots with a shared axis that are not in...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24958
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Doc]: Provide a working example for turning on specific axes labels when sharex or sharey are used with subplots","articleBody":"### Documentation Link\r\n\r\nhttps://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.subplots.html\r\n\r\n### Problem\r\n\r\nI find the feature to turn off the labels for all the subplots with a shared axis that are not in the edge of the subplots' grid surprising and confusing.\r\nThe documentation does state this as a wanted feature. And does state that turning the labels back on require one to use tick_params.\r\n\r\nHowever, it is not clear what the user needs to do to turn a specific axis's tick labels back on.\r\n\r\nI did not find a single example on how to do this in the entire documentation from Matplotlib.\r\n\r\nI would be happy to contribute writing a working example (I just need to know how to do it).\r\n\r\n### Suggested improvement\r\n\r\nTo include a working examples on how to turn a specific axis' tick label back on (one for the x-axis, a second for the y-axis).\r\n\r\nHere is the suggested starting point:\r\n\r\n```\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nn_cols = 4\r\nn_rows = 5\r\n\r\nfig, axs = plt.subplots(n_cols, n_rows, sharex = True, sharey = True)\r\n\r\nfor ax in axs.ravel():\r\n x = np.random.rand(20)\r\n y = np.random.rand(20)\r\n\r\n ax.scatter(x,y)\r\n\r\n# turn on x-axis tick labels at [2,2]\r\naxs[1,1].tick_params(labelbottom=True)\r\n\r\n# same for y-axis tick labels at [2,3]\r\naxs[1,2].tick_params(labelleft=True)\r\n\r\n# same for both x and y axes tick labels for [3,3]\r\naxs[2,2].tick_params(labelbottom=True, labelleft=True)\r\n\r\nplt.show()\r\n```","author":{"url":"https://github.com/benoitespinola","@type":"Person","name":"benoitespinola"},"datePublished":"2023-01-12T17:22:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/24958/matplotlib/issues/24958"}
| 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:5ca7b323-52dc-b175-546b-c9744e562d34 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E82A:1C38BA:28F0539:36C8D63:6A521639 |
| html-safe-nonce | f89820eeb14da3d10265d9ecde393ee0ab3629e7e0988c7b7d317b5d3b9fcd12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODJBOjFDMzhCQToyOEYwNTM5OjM2QzhENjM6NkE1MjE2MzkiLCJ2aXNpdG9yX2lkIjoiMjAxOTU1MDQ4OTcyOTk2MzU3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f51a7decea708e179715f6fbc82ec337cdd2f05bffa9995e06cf6d51a6c9ceac |
| hovercard-subject-tag | issue:1531099231 |
| 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/24958/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dbccfe3c9c9e3bdd841b47608092adb9ca94ee7b8911f584dccfe9b8ea6337e2/matplotlib/matplotlib/issues/24958 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dbccfe3c9c9e3bdd841b47608092adb9ca94ee7b8911f584dccfe9b8ea6337e2/matplotlib/matplotlib/issues/24958 |
| og:image:alt | Documentation Link https://matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.subplots.html Problem I find the feature to turn off the labels for all the subplots with a shared axis that are not in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benoitespinola |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width