-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Zero size figure use case #17093
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
Fair enough. I guess we need some checks for 0 size to bail as quickly as possible and make sure we don't segfault libpng in 3.2.x. |
It didn't segfault libpng (we had a RuntimeError instead, afaict) and doesn't cause any problems (well, other than a SystemError) with Pillow. (I think especially on 3.3+ we should just propagate out whatever exception Pillow generates; if people want some other exception for zero-sized figure they should just argue about that on the Pillow tracker.) |
This can happen if the figure is embedded in a larger GUI application. Closes matplotlib#17093
Bug report
Bug summary
I use matplotlib + PyQt5. The figure is placed inside a QSplitter (a standard Qt widget that consists of several vertical or horizontal parts which can be resized by handles between those parts) . When a part of QSplitter shrinks to a zero size it automatically resizes the widget it contains. Matplotlib raises an error as was mentioned in #16687.
Actual outcome
Expected outcome
A zero height figure.
Matplotlib version
The text was updated successfully, but these errors were encountered: