8000 Fix tight layout in pyplot.py by mdehoon · Pull Request #4851 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix tight layout in pyplot.py #4851

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

Closed
wants to merge 3 commits into from

Conversation

mdehoon
Copy link
Contributor
@mdehoon mdehoon commented Aug 2, 2015

This fixes issue #2654.
In figure.py, there is a figure.set_tight_layout function (to be used by frontend code) and a figure.tight_layout function (called as part of figure.draw).
Calling figure.tight_layout directly breaks the separation between frontend and backend, causing issue #2654.
In pyplot.py, there is a function tight_layout which calls figure.tight_layout. The tight_layout function in pyplot.py is frontend code, and should call figure.set_tight_layout instead.
This pull request ensures that tight_layout in pyplot.py calls figure.set_tight_layout, and also fixes the example scripts where figure.tight_layout was called instead of figure.set_tight_layout.
We should consider renaming set_tight_layout in figure.py to tight_layout to be consistent with tight_layout in pyplot.py (this is currently not included in this pull request).

mdehoon added 2 commits August 2, 2015 14:37
…o keep the frontend and the backend separate. This fixes issue 2654
@tacaswell tacaswell added this to the proposed next point release milestone Aug 3, 2015
@tacaswell
Copy link
Member

@mdehoon Do the tests pass locally for you?

… figure.set_tight_layout was called"

This reverts commit 9ee8cca.
@mdehoon
Copy link
Contributor Author
mdehoon commented Aug 5, 2015

This is all wrong -- tight_layout and set_tight_layout have different purposes.

@mdehoon mdehoon closed this Aug 5, 2015
@mdehoon mdehoon deleted the fixTightLayoutPyplot branch August 5, 2015 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0