-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Computing the bounding box of a degenerate polygon throws an error #17975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
attn @brunobeltran |
The new path extents code revealed an existing bug in the code that generates Path([[0,0], [0, 0]], [Path.MOVETO, Path.CLOSEPOLY]) but instead returns Path([[0,0]], [Path.CLOSEPOLY]) I'll push a fix shortly! Edit: phrasing |
I will note that while #17982 "fixes" the underlying bug, it does not revert to the same behavior as 3.2. The new behavior is >>> from matplotlib.patches import Polygon
>>> pp = Polygon([[0.,0.]])
>>> pp.get_extents()
Bbox([[0.0, 0.0], [0.0, 0.0]]) which seems more correct to me. Sure, a degenerate polygon has zero width ( If we have users that are relying on Matplotlib to not include a bunch of degenerate |
Maybe we consider that part of 'Fixed bug that computed a Path's Bbox incorrectly'. |
I agree with this, just wanted to make sure it didn't sneak past without someone else seeing the difference in case I was way off base. |
With 3.3.0, computing the bounding box of a degenerate (one-point) polygon throws an error
Code for reproduction
Actual outcome
Expected outcome
With 3.2:
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggThe text was updated successfully, but these errors were encountered: