Title: [Bug]: Setting ticks marks on a single spine doesn't work properly · Issue #25117 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Setting ticks marks on a single spine doesn't work properly · Issue #25117 · matplotlib/matplotlib
X Title: [Bug]: Setting ticks marks on a single spine doesn't work properly · Issue #25117 · matplotlib/matplotlib
Description: Bug summary When setting the tick length on the top spine only, it is also applied to the bottom spine, creating space between the bottom of the chart and the axis labels. Code for reproduction import matplotlib.pyplot as plt fig, ax = p...
Open Graph Description: Bug summary When setting the tick length on the top spine only, it is also applied to the bottom spine, creating space between the bottom of the chart and the axis labels. Code for reproduction imp...
X Description: Bug summary When setting the tick length on the top spine only, it is also applied to the bottom spine, creating space between the bottom of the chart and the axis labels. Code for reproduction imp...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/25117
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Setting ticks marks on a single spine doesn't work properly","articleBody":"### Bug summary\n\nWhen setting the tick length on the top spine only, it is also applied to the bottom spine, creating space between the bottom of the chart and the axis labels.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\nax.plot(range(2020, 2025),\r\n range(-2, 3))\r\n\r\nax.spines['top'].set_position('zero')\r\nax.spines['bottom'].set_visible(False)\r\nax.tick_params(labelbottom=True, labeltop=False, bottom=False, top=True)\r\nax.spines['top'].axis.set_tick_params(length=10)\r\nax.set_xticks(range(2020, 2025))\r\n\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\n\r\n\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nWindows\n\n### Matplotlib Version\n\n3.3.4\n\n### Matplotlib Backend\n\nTkAgg\n\n### Python version\n\n3.6.13\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/WWakker","@type":"Person","name":"WWakker"},"datePublished":"2023-01-31T18:40:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/25117/matplotlib/issues/25117"}
| 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:28f8a537-2001-035e-0908-63ac57f7e3cb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B96:1D4F69:2B7A4DB:3B1848D:6A53C395 |
| html-safe-nonce | 3e11e8343b81d7b53a876eafb8be33cdda665d36b89ea85c5ede5857914cf7c6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjk2OjFENEY2OToyQjdBNERCOjNCMTg0OEQ6NkE1M0MzOTUiLCJ2aXNpdG9yX2lkIjoiMzIxMDc1NzM1NDI4ODMwMDk0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2c780150630c9961e3144bf168480d60a0de1ee811ec1e7a8747358491569e66 |
| hovercard-subject-tag | issue:1564822637 |
| 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/25117/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d0a0cd1c1da2e56f75769e41df96065339ee12a2ead519b6a56703b3f7b92965/matplotlib/matplotlib/issues/25117 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d0a0cd1c1da2e56f75769e41df96065339ee12a2ead519b6a56703b3f7b92965/matplotlib/matplotlib/issues/25117 |
| og:image:alt | Bug summary When setting the tick length on the top spine only, it is also applied to the bottom spine, creating space between the bottom of the chart and the axis labels. Code for reproduction imp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WWakker |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width