FIX: update spine positions before get extents#11754
FIX: update spine positions before get extents#11754dstansby merged 4 commits intomatplotlib:masterfrom
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.
super().get_window_extent(renderer=renderer) instead?
|
...test done. The test fails on master.. |
lib/matplotlib/tests/test_axes.py
Outdated
|
|
||
| @image_comparison(baseline_images=['csd_freqs'], remove_text=True, | ||
| extensions=['png']) | ||
| extensions=['png'], tol=0.002) |
There was a problem hiding this comment.
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.
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.
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_tightbboxwould 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_extentis 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