Title: BF: for degenerate polygons, add CLOSEPOLY vertex by brunobeltran · Pull Request #17982 · matplotlib/matplotlib · GitHub
Open Graph Title: BF: for degenerate polygons, add CLOSEPOLY vertex by brunobeltran · Pull Request #17982 · matplotlib/matplotlib
X Title: BF: for degenerate polygons, add CLOSEPOLY vertex by brunobeltran · Pull Request #17982 · matplotlib/matplotlib
Description: PR Summary Fixes #17975. New iter_bezier code exposed an existing bug in patches.Polygon.set_xy. The check xy[0] != xy[-1] was meant to check if the user had already included an extra CLOSEPOLY vertex for us in the list of vertices (shape(xy) = (N, 2)). But for single-vertex (degenerate) Polygons, it produced a false positive (since xy[0] == xy[-1] by definition), leading to malformed Paths that look like: In [1]: from matplotlib.patches import Polygon In [2]: pp = Polygon([[0, 0]]) In [3]: pp.get_path() Out[3]: Path(array([[0., 0.]]), array([79], dtype=uint8)) 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/next_api_changes/* if API changed in a backward-incompatible way
Open Graph Description: PR Summary Fixes #17975. New iter_bezier code exposed an existing bug in patches.Polygon.set_xy. The check xy[0] != xy[-1] was meant to check if the user had already included an extra CLOSEPOLY ver...
X Description: PR Summary Fixes #17975. New iter_bezier code exposed an existing bug in patches.Polygon.set_xy. The check xy[0] != xy[-1] was meant to check if the user had already included an extra CLOSEPOLY ver...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/17982
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ce150c81-6301-b90d-c406-1d0483c310b5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B258:183E3C:F4932:14C167:6A5181DB |
| html-safe-nonce | 1b4781d427ca80a9928973954105449b2e06c2507430ee157f81593920e31449 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjU4OjE4M0UzQzpGNDkzMjoxNEMxNjc6NkE1MTgxREIiLCJ2aXNpdG9yX2lkIjoiOTEwMDExOTU5ODM2ODM5MTY0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 26dbd988319b6557b2df6d97b028b71206cd961f984a068edd38b5786a1567a9 |
| hovercard-subject-tag | pull_request:453856327 |
| 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/17982/files |
| twitter:image | https://avatars.githubusercontent.com/u/1475390?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1475390?s=400&v=4 |
| og:image:alt | PR Summary Fixes #17975. New iter_bezier code exposed an existing bug in patches.Polygon.set_xy. The check xy[0] != xy[-1] was meant to check if the user had already included an extra CLOSEPOLY ver... |
| 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 | d01c62704ef24df49056c63892a149b775e1353d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width