-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
set_size_inches() with forward=True sets the wrong size of the canvas with gtk2, gtk3 #7302
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
the OSX backend appears to resize the canvas, but doesn't resize the window at all. |
The 'qt' and 'qt4' backends do not appear to have this bug. |
@OceanWolf @fariza RE gtk @mdehoon RE osx |
Yes, lots of horrible inconsistent API usage that I fix with MEP27, see http://matplotlib.org/devel/MEP/MEP27.html#backward-compatibility |
The default for the 'forward' argument to figure.set_size_inches changed silently from 1.4.3 to 2.0.0, from 'False' to 'True'. Since some backends call this as part of their implementation, and don't explicitly specify a value for the 'forward' parameter, relying on the default value, this change (which is documented wrongly) caused various havocs to various back ends (including the Kivy one, which is how I found it.) |
This is related to MEP 27, but a different issue. |
I'm using
|
@keflavich does that get corrected once the window is shown? I can not reproduce this on linux. I wonder if this has something to do with retnia on mac? That can lead to weird factor of 2 resizing. |
@tacaswell No, it doesn't. And I agree, it seems very likely to be related to mac retina screens, but it seems to happen independent of whether I have an external monitor connected. My only workaround has been to use a non-displaying backend (i.e., pdf) to make pdf figures. Using |
I suspect that the font size issue is due to the fonts always being sized in absolute units (points), but everything else scales with the figure size. The figures are smaller, making the fonts look relatively bigger. |
version: 2.0.0b1+1773.g3590ce2, installed from source
OS: OSX 10.11.6
inside an ipython shell...
what happens to me: with gtk3, running this script the first time, the window pops up, everything is fine. If I then run this script again without doing anything else: the window doesn't change size, but the figure canvas does, pushing the title and the top part of the plot above the top of the window. If I then grab the window resizer and change the size of the window, I see the entire plot (so that signal works).
with gtk2, the same behavior occurs except: the part of the canvas that disappears is the bottom of the plot instead of the top.
As an aside, when this happens, before resizing the window, the zoom-to-rectangle function grabs a rectangle that is offset from the mouse pointer.
Hypothesis: the code is counting the toolbar extents as part of the size of the canvas.
[edited to add code markup tacaswell]
The text was updated successfully, but these errors were encountered: