Title: FIX: always use at least 2 ticks and recompute by tacaswell · Pull Request #5772 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: always use at least 2 ticks and recompute by tacaswell · Pull Request #5772 · matplotlib/matplotlib
X Title: FIX: always use at least 2 ticks and recompute by tacaswell · Pull Request #5772 · matplotlib/matplotlib
Description: For extreme aspect-ratio plots the auto ntick logic would decide that no ticks will fit, leading to divide by 0 issue. This changes the logic in Axis.get_tick_space to have a floor of 1. also does not cache the number of ticks so that if the on-screen aspect ratio changes the number of ticks will update correctly. I tried to add a test for this, but something about the testing framework is causing trouble import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.set_aspect('equal') ax.set_xlim(0, 1000) fig.canvas.draw() print(ax.yaxis.get_major_locator()()) print(ax.xaxis.get_major_locator()()) assert len(ax.yaxis.get_major_locator()()) == 2 ax.set_ylim(0, 1000) fig.canvas.draw() assert len(ax.yaxis.get_major_locator()()) > 2 runs correctly as a script for me and interactively, but as part of the test suite give 6 ticks in the first case.
Open Graph Description: For extreme aspect-ratio plots the auto ntick logic would decide that no ticks will fit, leading to divide by 0 issue. This changes the logic in Axis.get_tick_space to have a floor of 1. also does...
X Description: For extreme aspect-ratio plots the auto ntick logic would decide that no ticks will fit, leading to divide by 0 issue. This changes the logic in Axis.get_tick_space to have a floor of 1. also does...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/5772
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c62de6fe-b090-247a-8f10-23db1c5ad57d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EB38:243C42:10306:13F72:6A532353 |
| html-safe-nonce | 00bbc04b68d65bfeb57b4f07863760bb20b728da88bf3ac82ca791cb3e49b2f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjM4OjI0M0M0MjoxMDMwNjoxM0Y3Mjo2QTUzMjM1MyIsInZpc2l0b3JfaWQiOiIzMDg4MzEzMzY0MzAyMjA5ODc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3e66355e5cda789c7cb3da33b5f184759173fae8cc9f710da8cd0effb07e5ad6 |
| hovercard-subject-tag | pull_request:54871512 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/5772/files |
| twitter:image | https://avatars.githubusercontent.com/u/199813?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/199813?s=400&v=4 |
| og:image:alt | For extreme aspect-ratio plots the auto ntick logic would decide that no ticks will fit, leading to divide by 0 issue. This changes the logic in Axis.get_tick_space to have a floor of 1. also does... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| 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