-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix bug when resizing qt4 figure window. #756
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
Conversation
Resizing window didn't account for toolbar and status bar heights.
Sorry to be dense but what do I need to do to see the before and after behavior. I tries launching the simple_plot.py example before and after w/ the qt4agg backend and resizing the window, but didn't notice any difference. |
Sorry, I wasn't clear in the pull request: this is for resizing in code. I sent the following to the mailing list, but forgot to add it to the PR. import matplotlib as mpl
mpl.use('qt4agg')
import matplotlib.pyplot as plt
fig = plt.figure()
fig.set_size_inches(2, 2, forward=True)
plt.figure(figsize=(2, 2))
plt.show() In theory, the two figures should be the same size, but since the code path for |
BTW, in the email, I mentioned that I couldn't test whether this change affected |
This anomaly is not confined to the qt4agg backend; I see it in the gtkagg backend also. TkAgg gives wildly different sizes. WxAgg gives two windows the same size, but without the unit aspect ratio that the canvas area should have. It's a real mess. |
Yeah, I noticed the TkAgg issue as well (I don't have GTK or Wx installed). I tried to dig into the TkAgg backend, but for some reason, I came to the conclusion that I would not be able to figure out a fix without considerable effort. And macosx has issues too: resizing causes a dark gray region to shrink to the specified size, but the window itself remains unchanged. |
Ah, this is a mess. It would be great to get to the bottom of this. And while, of course, it's ideal to fix this in all backends, since this is really a bugfix and not a new feature, I think it's find to merge this and file a new issue that resizing doesn't work correctly in the gtk, wx, tk backends. Better that than to hold up this PR waiting for all the other backends to be fixed. |
Fix bug when resizing qt4 figure window.
Resizing window didn't account for toolbar and status bar heights.
This PR duplicates #748, but is based off of v1.1.x instead of master.