Fix axhspan/axvspan view limits autoscaling #7774

Closed
wants to merge 2 commits into
from

Projects

Needs review in Reviewing pull requests.

4 participants

@larrybradley
Contributor
larrybradley commented Jan 9, 2017 edited

Currently using axhspan or axvspan on an image results in the axis view limits being changed even when the axhspan/axvspan patch is fully within the image. This PR changes the behavior to match axhline and axvline.

@larrybradley larrybradley Fix axhspan/axvspan view limits autoscaling
ce030fd
@larrybradley
Contributor

The single failing travis test seems unrelated:

E matplotlib.testing.exceptions.ImageComparisonFailure: images not close: /home/travis/build/matplotlib/matplotlib/result_images/test_mplot3d/mixedsubplot_svg.png vs. /home/travis/build/matplotlib/matplotlib/result_images/test_mplot3d/mixedsubplot-expected_svg.png (RMS 0.104)

I cannot reproduce this locally and that particular image does not use axhspan or axvspan.

@phobson

@larrybradley I agree that the test failure is unrelated to this PR.

Would you mind writing an additional test that demonstrates the problem this is PR is fixing?

My guess is that it doesn't actually need to be an image comparison test. You could just inspect/compare the axes limits before and after calls to ax[h|v]span

@codecov-io

Current coverage is 62.21% (diff: 100%)

Merging #7774 into master will increase coverage by 0.10%

@@             master      #7774   diff @@
==========================================
  Files           174        174          
  Lines         56028      56205   +177   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          34803      34970   +167   
- Misses        21225      21235    +10   
  Partials          0          0          

Powered by Codecov. Last update 0c54bee...ce030fd

@larrybradley larrybradley Add tests for ax[h|v]span autoscale limits
3fa97c6
@larrybradley
Contributor

@phobson Thanks for the review. I've added the tests.

@larrybradley
Contributor

The single failing travis test is again an unrelated image-comparison test.

@phobson phobson changed the title from Fix axhspan/axvspan view limits autoscaling to [MRG+1] Fix axhspan/axvspan view limits autoscaling Jan 10, 2017
@anntzer
Contributor
anntzer commented Jan 14, 2017

This is actually already fixed in 2.0rc2 (testing with the PR tests), so I'll close it. Feel free to let me know (with a minimal example) if you believe I missed something.

@anntzer anntzer closed this Jan 14, 2017
@anntzer anntzer changed the title from [MRG+1] Fix axhspan/axvspan view limits autoscaling to Fix axhspan/axvspan view limits autoscaling Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment