Title: Computing the bounding box of a degenerate polygon throws an error · Issue #17975 · matplotlib/matplotlib · GitHub
Open Graph Title: Computing the bounding box of a degenerate polygon throws an error · Issue #17975 · matplotlib/matplotlib
X Title: Computing the bounding box of a degenerate polygon throws an error · Issue #17975 · matplotlib/matplotlib
Description: With 3.3.0, computing the bounding box of a degenerate (one-point) polygon throws an error Code for reproduction from matplotlib.patches import Polygon pp=Polygon([[0.,0.]]) pp.get_extents() Actual outcome ValueError Traceback (most rece...
Open Graph Description: With 3.3.0, computing the bounding box of a degenerate (one-point) polygon throws an error Code for reproduction from matplotlib.patches import Polygon pp=Polygon([[0.,0.]]) pp.get_extents() Actual...
X Description: With 3.3.0, computing the bounding box of a degenerate (one-point) polygon throws an error Code for reproduction from matplotlib.patches import Polygon pp=Polygon([[0.,0.]]) pp.get_extents() Actual...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/17975
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Computing the bounding box of a degenerate polygon throws an error","articleBody":"With 3.3.0, computing the bounding box of a degenerate (one-point) polygon throws an error\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nfrom matplotlib.patches import Polygon \r\npp=Polygon([[0.,0.]]) \r\npp.get_extents() \r\n```\r\n\r\n**Actual outcome**\r\n\r\n```\r\nValueError Traceback (most recent call last)\r\n\u003cipython-input-3-1312a177eac2\u003e in \u003cmodule\u003e\r\n----\u003e 1 pp.get_extents()\r\n\r\n/usr/lib/python3.8/site-packages/matplotlib/patches.py in get_extents(self)\r\n 254 Return the `Patch`'s axis-aligned extents as a `~.transforms.Bbox`.\r\n 255 \"\"\"\r\n--\u003e 256 return self.get_path().get_extents(self.get_transform())\r\n 257 \r\n 258 def get_transform(self):\r\n\r\n/usr/lib/python3.8/site-packages/matplotlib/path.py in get_extents(self, transform, **kwargs)\r\n 590 self = transform.transform_path(self)\r\n 591 bbox = Bbox.null()\r\n--\u003e 592 for curve, code in self.iter_bezier(**kwargs):\r\n 593 # places where the derivative is zero can be extrema\r\n 594 _, dzeros = curve.axis_aligned_extrema()\r\n\r\n/usr/lib/python3.8/site-packages/matplotlib/path.py in iter_bezier(self, **kwargs)\r\n 442 if first_vert is None:\r\n 443 if code != Path.MOVETO:\r\n--\u003e 444 raise ValueError(\"Malformed path, must start with MOVETO.\")\r\n 445 if code == Path.MOVETO: # a point is like \"CURVE1\"\r\n 446 first_vert = verts\r\n\r\nValueError: Malformed path, must start with MOVETO.\r\n```\r\n\r\n**Expected outcome**\r\n\r\nWith 3.2:\r\n```\r\nBbox([[inf, inf], [-inf, -inf]])\r\n```\r\n\r\n**Matplotlib version**\r\n * Operating system: Linux x86_64\r\n * Matplotlib version: 3.3.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.8.4\r\n","author":{"url":"https://github.com/antonio-rojas","@type":"Person","name":"antonio-rojas"},"datePublished":"2020-07-20T13:08:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/17975/matplotlib/issues/17975"}
| 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:b0340a19-83d6-21fb-3c02-038dbd300c0c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A110:3061A4:B7078C:F9BD32:6A5162A1 |
| html-safe-nonce | 4f69cca44f09feb3b4b30d5fb623964fd2f521bca80e58e2ff3336855915a886 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTEwOjMwNjFBNDpCNzA3OEM6RjlCRDMyOjZBNTE2MkExIiwidmlzaXRvcl9pZCI6IjUyNjI1Nzc3MDQyMjQyODMyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f9149fb0c8ce0fa5fe12d1ae2efc127bb7a244a393e49e1e31bb477bca8ff4d5 |
| hovercard-subject-tag | issue:661803723 |
| 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/17975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/13e2f21a027ac5cc55a4ea2f777d44e7a6f6f56c9a6714773dfee428cf409ca5/matplotlib/matplotlib/issues/17975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/13e2f21a027ac5cc55a4ea2f777d44e7a6f6f56c9a6714773dfee428cf409ca5/matplotlib/matplotlib/issues/17975 |
| og:image:alt | With 3.3.0, computing the bounding box of a degenerate (one-point) polygon throws an error Code for reproduction from matplotlib.patches import Polygon pp=Polygon([[0.,0.]]) pp.get_extents() Actual... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | antonio-rojas |
| 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 | 2eeb434949a926fad21064b4d395a54759f7a0b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width