FIX: don't pad axes for ticks if they aren't visible or axis off#11210
Merged
phobson merged 2 commits intomatplotlib:masterfrom Jun 5, 2018
Merged
FIX: don't pad axes for ticks if they aren't visible or axis off#11210phobson merged 2 commits intomatplotlib:masterfrom
phobson merged 2 commits intomatplotlib:masterfrom
Conversation
timhoffm
approved these changes
May 9, 2018
Member
Author
|
test added.... |
phobson
approved these changes
Jun 5, 2018
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
Since 1.5.3 (two years ago) we added:
matplotlib/lib/matplotlib/axes/_base.py
Lines 580 to 589 in 1652ed1
First, this seems like a funny place to put the padding for ticks - I'd have expected it to be in the axis bbox, not the axes bbox. But presumably someone wanted to know the extent of the axes and its ticks w/o knowing the rest of the decorators? The original issues that spurred #5683 seemed to be tight_layout not respecting outward ticks. IMHO this "fix" was wrong and the axis bboxes should include the ticks not the
axes, Butxaxis.get_tightbboxdoes not include the ticks even though it controls everything about the ticks.Second,
ax.set_axis_offsets aax.axison=False, but it doesn't change the visibility of the axis, which is still True. I haven't fixed this, but it seems strange to have two flags that control the visibility of an axis.Anyways, this is an easy fix given how things are now to make the tightbbox actually behave like there are no ticks present.
Closes: #11203
before
after
PR Checklist