tk: Resize the canvas, not the figure.#16929
Merged
Merged
Conversation
Resizing the figure directly does not account for the toolbar, so figures are actually a little shorter than they should be. The recent change to `Text.get_window_extent` some how causes this to actually get reflected in the Matplotlib figure size, which cycles back to Tk and shrinks the window. However, this can be triggered by other calls to `Figure.set_size_inches` as noted in the fixed issues. Fixes matplotlib#10083. Fixes matplotlib#10566. Fixes matplotlib#16926.
2 tasks
Member
Author
|
This could be backported to 3.2.2 if anyone feels strongly since it fixes other bugs, but it's not a regression, so it doesn't have to. |
anntzer
approved these changes
Mar 27, 2020
Member
|
Seems easy enough to backport, so I've tagged as 3.2. |
dstansby
approved these changes
Mar 27, 2020
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Mar 27, 2020
timhoffm
added a commit
that referenced
this pull request
Mar 27, 2020
…929-on-v3.2.x Backport PR #16929 on branch v3.2.x (tk: Resize the canvas, not the figure.)
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Resizing the figure directly does not account for the toolbar, so figures are actually a little shorter than they should be. The recent change to
Text.get_window_extentsome how causes this to actually get reflected in the Matplotlib figure size, which cycles back to Tk and shrinks the window. However, this can be triggered by other calls toFigure.set_size_inchesas noted in the linked issues.Fixes #10083.
Fixes #10566.
Fixes #16926.
PR Checklist