Title: FIX: fallback to viewlims if no data by jklymak · Pull Request #13588 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: fallback to viewlims if no data by jklymak · Pull Request #13588 · matplotlib/matplotlib
X Title: FIX: fallback to viewlims if no data by jklymak · Pull Request #13588 · matplotlib/matplotlib
Description: PR Summary Closes #11337 The following test would fail because the view limit was set from 0-1: x = np.array([datetime.datetime(2017, 1, n) for n in range(1, 6)]) y = np.array([1,2,3,4,5]) m = np.ma.masked_greater(y, 0) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x, m) # these are the default viewlim assert ax.get_xlim() == (730120.0, 733773.0) The issue was in autoscale_view, which never checked the axes.viewLim, even if the data lim came back undefined. This PR checks the viewlim and uses that if the datalim is not finite. Note this issue is more generic than dates, but is most easily seen there because we can't have dates with ordinal values <1, and the default behaviour made it so such dates were the datalim. PR Checklist Has Pytest style unit tests Code is Flake 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: PR Summary Closes #11337 The following test would fail because the view limit was set from 0-1: x = np.array([datetime.datetime(2017, 1, n) for n in range(1, 6)]) y = np.array([1,2,3,4,5]) ...
X Description: PR Summary Closes #11337 The following test would fail because the view limit was set from 0-1: x = np.array([datetime.datetime(2017, 1, n) for n in range(1, 6)]) y = np.array([1,2,3,4,5]) ...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/13588
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4ac6ac16-b5a8-cbcc-1503-4d3a19f55c7f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EC36:39D6FF:20B82E0:2C9B2B5:6A538BA8 |
| html-safe-nonce | a612589c17a7f2b8533205f10c8fabab0b5468714a64299bf71b71e96dfc2104 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzM2OjM5RDZGRjoyMEI4MkUwOjJDOUIyQjU6NkE1MzhCQTgiLCJ2aXNpdG9yX2lkIjoiNTczMTQ0MDE1OTU2NTc3NzgzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 23dd5c63cfc963f65fe56d22ea78866953c2d6660b4ac120a60d5609bab7d573 |
| hovercard-subject-tag | pull_request:258105838 |
| 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/13588/files |
| twitter:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1562854?s=400&v=4 |
| og:image:alt | PR Summary Closes #11337 The following test would fail because the view limit was set from 0-1: x = np.array([datetime.datetime(2017, 1, n) for n in range(1, 6)]) y = np.array([1,2,3,4,5]) ... |
| 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