Skip to content

Commit 9d61661

Browse files
authored
Update _base.py
1 parent 4a5d09c commit 9d61661

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,8 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
16801680
aspect = 1
16811681
if not cbook._str_equal(aspect, 'auto'):
16821682
aspect = float(aspect) # raise ValueError if necessary
1683+
if aspect<0:
1684+
raise ValueError("aspect must be positive")
16831685

16841686
if share:
16851687
axes = {sibling for name in self._axis_names

0 commit comments

Comments
 (0)