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
Set forward=True by default when setting the figure size #4680
Comments
👍 on this from me |
It sounds sensible to me too |
This will require some extra GUI testing come rc time, but 👍 |
This seems to cause some sort of feedback loop with TkAgg on Linux (Gnome). If you manually drag the window size, it rapidly changes size in the range around 50 pixels or so from the cursor. Haven't really investigated a fix yet. |
The resize callbacks should probably explicitly pass forward=False ? On Tue, Nov 17, 2015, 17:44 Michael Droettboom notifications@github.com
|
This API change is undocumented. In addition, the forward keyword argument is documented to default to False in the code. And this seems to have broken a number of backends, including the Kivy one. |
I'll update the documentation asap. How did this break kivy? |
It looks like that the documentation was in one of the commits referenced here, but got lost in the shuffle, sorry about that. See 0d817d0 for what we changed internally. |
The Kivy backend was originally written against 1.4.3, and it called set_size_inches() to update the size of the figure. But when run against 2.0.0 (and I think 1.5.x), it resulted in a comical quantized shrinking of the window to nothing. Because the new and hidden "forward=True" (which by the way seems ill-advised to me) was causing a call to FigureManagerBase.resize() which resized the window, which triggered a resize of the canvas, which caused a call to set_size_inches(), which... |
#8008 adds documentation for this. The reason for this change is so that you can do Sorry we broke things, but at least this one is easy to fix! |
Yes, I understand the reasoning. I just think that setting the figure size and setting the window size are different enough not to be automatically conflated. I could see a config variable you could set to explicitly make that linkage, though. |
Is this change only in 2.1? 2.0 and older don't reflect this change: http://matplotlib.org/2.0.0/api/figure_api.html#matplotlib.figure.Figure.set_size_inches Also it is very confusing that the default is still |
@jkjk822 That is an error in the docs, corrected in http://matplotlib.org/2.0.2/api/figure_api.html#matplotlib.figure.Figure.set_size_inches |
@tacaswell Oh I see, thanks! What about the second point? Any plans to make the behavior consistent for |
Original discussion: #4677
It might make more sense to have
forward=True
by default when callingset_size_inches
, so that the bounding box of the figure will automatically update when the figure size is changed.The text was updated successfully, but these errors were encountered: