@@ -587,18 +587,6 @@ def _determine_lims(self, xmin=None, xmax=None, *args, **kwargs):
587
587
xmax += 0.05
588
588
return (xmin , xmax )
589
589
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
-
602
590
def set_xlim3d (self , left = None , right = None , emit = True , auto = False , ** kw ):
603
591
"""
604
592
Set 3D x limits.
@@ -617,8 +605,8 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False, **kw):
617
605
left , right = left
618
606
619
607
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 )
622
610
623
611
old_left , old_right = self .get_xlim ()
624
612
if left is None :
@@ -669,14 +657,14 @@ def set_ylim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
669
657
bottom , top = bottom
670
658
671
659
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 )
676
662
677
663
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
680
668
681
669
if top == bottom :
682
670
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):
721
709
bottom , top = bottom
722
710
723
711
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 )
726
714
727
715
old_bottom , old_top = self .get_zlim ()
728
716
if bottom is None :
0 commit comments