-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: update spine positions before get extents #11754
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
FIX: update spine positions before get extents #11754
Conversation
Seems to work, thanks! |
@fredrik-1 Great! And thanks for catching this before 3.0 went out. Now to devise a test that fails if this doesn't work... |
lib/matplotlib/spines.py
Outdated
# make sure the location is updated so that transforms etc are | ||
# correct: | ||
self._adjust_location() | ||
return self.get_path().get_extents(self.get_transform()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super().get_window_extent(renderer=renderer)
instead?
...test done. The test fails on master.. |
lib/matplotlib/tests/test_axes.py
Outdated
@@ -4031,7 +4031,7 @@ def test_psd_noise(): | |||
|
|||
|
|||
@image_comparison(baseline_images=['csd_freqs'], remove_text=True, | |||
extensions=['png']) | |||
extensions=['png'], tol=0.002) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix is for the macOS test and doesn't affect this PR. Happy to remove it if the commits will be cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you throw this in another PR? It would be good to get to the bottom of the cause (I'll investigate later today) before just adding a tolerance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from this PR. I'll not open a new PR in lieu of you tracking down the problem (I assume you have a Mac?) If you want me to play around w/ np1.15 I can also give that a shot. Note that I don't get the test failure on my mac w/ np1.14.
0ab9951
to
5545050
Compare
The only failure is the Mac CI small 0.001 tolerance issue w/ csd caused by numpy1.15 |
PR Summary
Closes #11737 (supercedes #11739, #11742)
If you zoomed on an axes,
get_tightbbox
would return a huge bounding box because spine objects didn't have their x/ylims properly set from the axis info yet. This PR sets those limits whenget_window_extent
is called making the bounding box accurate..This also rolls back a change in #11627 where constrained_layout was turned off under ZOOM and PAN...
PR Checklist