Title: Handle NaN values in `plot_surface` zsort by tomneep · Pull Request #20646 · matplotlib/matplotlib · GitHub
Open Graph Title: Handle NaN values in `plot_surface` zsort by tomneep · Pull Request #20646 · matplotlib/matplotlib
X Title: Handle NaN values in `plot_surface` zsort by tomneep · Pull Request #20646 · matplotlib/matplotlib
Description: PR Summary Closes #8222 #12395 While investigating different ways of solving #18114 I came across the issue where NaNs in data causing strange plotting issues. I tracked this down to the sorting of polygons where the python builtin sorted method is used. This doesn’t deal with NaNs so we need to be sure to make the zsort functions NaN safe. This does that by checking if the function returns NaN and if so returning sys.maxsize. I want to separate this from #18114 as I found two open issues I think it solves, #8222 and #12395. plot_surface does warn that it can't deal with NaNs but it looks like that was added in response to #12395. This seems to solve that, so perhaps the warning can be removed? I still need to add some tests but I wanted to check there was interest in adding this before writing those. It seems like a fairly simple problem to solve so maybe there is some deeper reason this hasn't been done? The before and after plots of the two issues are #8222 Before #8222 After #12395 Before #12395 After PR Checklist Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (run flake8 on changed files to check). New features are documented, with examples if plot related. Documentation is sphinx and numpydoc compliant (the docs should build without error). Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all). New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there). API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
Open Graph Description: PR Summary Closes #8222 #12395 While investigating different ways of solving #18114 I came across the issue where NaNs in data causing strange plotting issues. I tracked this down to the sorting of...
X Description: PR Summary Closes #8222 #12395 While investigating different ways of solving #18114 I came across the issue where NaNs in data causing strange plotting issues. I tracked this down to the sorting of...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/20646
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:03da770e-8180-e398-fba1-32206770c700 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B54:3B4DC0:A9B3E:E1AE1:6A5585C0 |
| html-safe-nonce | a614fe7130df5ad700a7cad4b4cd756a12c082087b8456baa299230bc68a1e17 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjU0OjNCNERDMDpBOUIzRTpFMUFFMTo2QTU1ODVDMCIsInZpc2l0b3JfaWQiOiI4NTc1MDA0OTc4MjI1NDQ4Mzg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6380f98fcf39cbf58b7254b6901e947f6070c042c737c1414dd98c8c1fc008b0 |
| hovercard-subject-tag | pull_request:689924115 |
| 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/20646/files |
| twitter:image | https://avatars.githubusercontent.com/u/17545360?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/17545360?s=400&v=4 |
| og:image:alt | PR Summary Closes #8222 #12395 While investigating different ways of solving #18114 I came across the issue where NaNs in data causing strange plotting issues. I tracked this down to the sorting of... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3215163789b3dc58dba97bd78a30c20c949f477f |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width