-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
The default backend (Qt4Agg) seems to change the figure size #7472
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
related to #7353 |
I can't seem to reproduce this with Qt4; are you sure you aren't using Qt5? |
Even though the minimum height is set, that doesn't seem to carry over to the size hint that gets used later to determine the size of the entire window, causing the window to be a bit too short and changing the size of the canvas. Fixes matplotlib#7353. Probably also fixes matplotlib#7472.
@QuLogic I thought I was using qt4 in #7353 , but I could be wrong (as I work in conda envs and may have accidentally jumped to qt5 and I know @anntzer is using qt5). @Patrick5 The 1.5.3 builds from continuum pin to qt5 (see ContinuumIO/anaconda-issues#1068) Can you check the output of |
FWIW I cannot reproduce this with mpl1.5.3 or 2.0rc1 / qt4agg or qt5agg on Arch Linux. |
Weird, I thought I could reproduce this yesterday, but I can't seem to find those results and can't reproduce now. Anyway, if it's actually Qt5, then I'm pretty sure this is the same as #7353. |
get_backend() reports 'Qt4Agg'. Also, I am still on Python 3.5.2 for
what that is worth.
I have not had time to upgrade either QT or Python.
I am not surprised if the bug does not occur on Linux - I had an idea
that the problem results from computing the window size but getting the
sizes of the individual parts wrong by a few pixels. That computation is
probably OS specific.
…On 12/11/2016 10:44 AM, Thomas A Caswell wrote:
@QuLogic <https://github.com/QuLogic> I /thought/ I was using qt4 in
#7353 <#7353> , but I
could be wrong (as I work in conda envs and may have accidentally
jumped to qt5 and I know @anntzer <https://github.com/anntzer> is
using qt5).
@Patrick5 <https://github.com/Patrick5> The 1.5.3 builds from
continuum pin to qt5 (see ContinuumIO/anaconda-issues#1068
<ContinuumIO/anaconda-issues#1068>) Can you
check the output of |matplotlib.get_backend()|?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7472 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG7r1BTST6hEL2fug5HepHL5AR7OWzGrks5rHESqgaJpZM4K0oXx>.
|
Manually re-opening as this may be OS specific. |
Based on #17391, this seems to only be a problem with Qt5Agg on macOS now. |
It's currently failing because of incorrect resizing when the window is opened. matplotlib#7472
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
I could not reproduce this on OSX with the qtAgg backend. I am going to close this is fixed unless someone else can reproduce it. |
The default backend (Qt4Agg) seems to be changing my figure size. The problem does not occur in AGG, TKAGG, or WEBAGG backends. I have not tested others.
Matplotlib version: 1.5.3 installed via anaconda
Python version: 3.5.2
Platform: Windows 8.1
The following is the minimal code I came up with that will reproduce the problem:
import matplotlib.pyplot as plt
fig = plt.figure()
print('size before:', fig.get_size_inches())
fig.canvas.flush_events()
fig.canvas.flush_events()
print('size after:', fig.get_size_inches())
This produces console output:
size before: [ 8. 6.]
size after: [ 8. 5.95]
In more general use this typically arises after a couple of frames have been displayed, and specifically causes a problem when making a movie from those displayed images: the output rolls by 5 pixels from frame to frame. Playing back the resulting mp4 looks like an old analog TV with the vertical sync out of whack.
BTW, one workaround is to call
fig.set_size_inches(8,6)
after the second flush above but before any frames are generated or grabbed, as the size does not seem to get changed again.The text was updated successfully, but these errors were encountered: