Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Raise exception if negative height or width is passed to axes() #7783
+2
−0
Conversation
| @@ -483,6 +483,9 @@ def __init__(self, fig, rect, | ||
| self._position = rect | ||
| else: | ||
| self._position = mtransforms.Bbox.from_bounds(*rect) | ||
| + x0, y0, x1, y1 = self._position.extents | ||
| + if ((x1 - x0) < 0 or (y1 - y0) < 0): |
tacaswell
added this to the
2.1 (next point release)
milestone
Jan 10, 2017
| @@ -483,6 +483,8 @@ def __init__(self, fig, rect, | ||
| self._position = rect | ||
| else: | ||
| self._position = mtransforms.Bbox.from_bounds(*rect) | ||
| + if self._position.width < 0 or self._position.height < 0: | ||
| + raise ValueError('Height and width specified must be non-negative') |
anntzer
Jan 11, 2017
Contributor
Very minor point: probably "Width and height must be non-negative" is better (as the order is x, y). I wouldn't add "specified" but I'll let a native speaker chime in :p
|
Commits squashed! |
codecov-io
commented
Jan 11, 2017
•
Current coverage is 62.11% (diff: 50.00%)@@ master #7783 diff @@
==========================================
Files 174 174
Lines 56028 56030 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 34805 34804 -1
- Misses 21223 21226 +3
Partials 0 0
|
|
LGTM. |
anntzer
changed the title from
Raise exception if negative height or width is passed to axes() to [MRG+1] Raise exception if negative height or width is passed to axes()
Jan 11, 2017
dopplershift
merged commit d7b7522
into matplotlib:master
Jan 11, 2017
3 of 5 checks passed
codecov/patch
50.00% of diff hit (target 62.12%)
Details
codecov/project
62.11% (-0.01%) compared to d181f63
Details
continuous-integration/appveyor/pr
AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
coverage/coveralls
Coverage decreased (-0.004%) to 62.117%
Details
dopplershift
changed the title from
[MRG+1] Raise exception if negative height or width is passed to axes() to Raise exception if negative height or width is passed to axes()
Jan 11, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
samsontmr commentedJan 10, 2017
Fixes #7487