@@ -587,18 +587,6 @@ def _determine_lims(self, xmin=None, xmax=None, *args, **kwargs):
587587 xmax += 0.05
588588 return (xmin , xmax )
589589
590- def _validate_axis_limits (self , limit , convert ):
591- """
592- Raise ValueError if specified axis limits are infinite.
593-
594- """
595- if limit is not None :
596- converted_limits = convert (limit )
597- if (isinstance (limit , float ) and
598- (not np .isreal (limit ) or not np .isfinite (limit ))):
599- raise ValueError ("Axis limits cannot be NaN or Inf" )
600- return converted_limits
601-
602590 def set_xlim3d (self , left = None , right = None , emit = True , auto = False , ** kw ):
603591 """
604592 Set 3D x limits.
@@ -617,8 +605,8 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False, **kw):
617605 left , right = left
618606
619607 self ._process_unit_info (xdata = (left , right ))
620- left = self ._validate_axis_limits (left , self .convert_xunits )
621- right = self ._validate_axis_limits (right , self .convert_xunits )
608+ left = self ._validate_converted_limits (left , self .convert_xunits )
609+ right = self ._validate_converted_limits (right , self .convert_xunits )
622610
623611 old_left , old_right = self .get_xlim ()
624612 if left is None :
@@ -669,14 +657,14 @@ def set_ylim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
669657 bottom , top = bottom
670658
671659 self ._process_unit_info (ydata = (bottom , top ))
672- if bottom is not None :
673- bottom = self .convert_yunits (bottom )
674- if top is not None :
675- top = self .convert_yunits (top )
660+ bottom = self ._validate_converted_limits (bottom , self .convert_yunits )
661+ top = self ._validate_converted_limits (top , self .convert_yunits )
676662
677663 old_bottom , old_top = self .get_ylim ()
678- bottom = self ._validate_axis_limits (bottom , self .convert_yunits )
679- top = self ._validate_axis_limits (top , self .convert_yunits )
664+ if bottom is None :
665+ bottom = old_bottom
666+ if top is None :
667+ top = old_top
680668
681669 if top == bottom :
682670 warnings .warn (('Attempting to set identical bottom==top results\n '
@@ -721,8 +709,8 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
721709 bottom , top = bottom
722710
723711 self ._process_unit_info (zdata = (bottom , top ))
724- bottom = self ._validate_axis_limits (bottom , self .convert_yunits )
725- top = self ._validate_axis_limits (top , self .convert_yunits )
712+ bottom = self ._validate_converted_limits (bottom , self .convert_zunits )
713+ top = self ._validate_converted_limits (top , self .convert_zunits )
726714
727715 old_bottom , old_top = self .get_zlim ()
728716 if bottom is None :
0 commit comments