|
|
@@ -2875,6 +2875,11 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw): |
|
|
if right is not None:
|
|
|
right = self.convert_xunits(right)
|
|
|
|
|
|
+ if ((left is not None and not np.isfinite(left)) or
|
|
|
+ (right is not None and not np.isfinite(right))):
|
|
|
+ raise ValueError("Specified x limits must be finite; "
|
|
|
+ "instead, found: (%s, %s)" % (left, right))
|
|
|
+
|
|
|
old_left, old_right = self.get_xlim()
|
|
|
if left is None:
|
|
|
left = old_left
|
|
|
@@ -3169,6 +3174,11 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False, **kw): |
|
|
if top is not None:
|
|
|
top = self.convert_yunits(top)
|
|
|
|
|
|
+ if ((top is not None and not np.isfinite(top)) or
|
|
|
+ (bottom is not None and not np.isfinite(bottom))):
|
|
|
+ raise ValueError("Specified y limits must be finite; "
|
|
|
+ "instead, found: (%s, %s)" % (bottom, top))
|
|
|
+
|
|
|
old_bottom, old_top = self.get_ylim()
|
|
|
|
|
|
if bottom is None:
|
|
|
|
One last thing, could a
@cleanupdecorator go above this line. Otherwise looks good!