@@ -536,11 +536,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True,
536536 self ._shared_x_axes .clean ()
537537 x0 , x1 = self .xy_dataLim .intervalx
538538 xlocator = self .xaxis .get_major_locator ()
539- try :
540- x0 , x1 = xlocator .nonsingular (x0 , x1 )
541- except AttributeError :
542- x0 , x1 = mtransforms .nonsingular (x0 , x1 , increasing = False ,
543- expander = 0.05 )
539+ x0 , x1 = xlocator .nonsingular (x0 , x1 )
544540 if self ._xmargin > 0 :
545541 delta = (x1 - x0 ) * self ._xmargin
546542 x0 -= delta
@@ -553,11 +549,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True,
553549 self ._shared_y_axes .clean ()
554550 y0 , y1 = self .xy_dataLim .intervaly
555551 ylocator = self .yaxis .get_major_locator ()
556- try :
557- y0 , y1 = ylocator .nonsingular (y0 , y1 )
558- except AttributeError :
559- y0 , y1 = mtransforms .nonsingular (y0 , y1 , increasing = False ,
560- expander = 0.05 )
552+ y0 , y1 = ylocator .nonsingular (y0 , y1 )
561553 if self ._ymargin > 0 :
562554 delta = (y1 - y0 ) * self ._ymargin
563555 y0 -= delta
@@ -570,11 +562,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True,
570562 self ._shared_z_axes .clean ()
571563 z0 , z1 = self .zz_dataLim .intervalx
572564 zlocator = self .zaxis .get_major_locator ()
573- try :
574- z0 , z1 = zlocator .nonsingular (z0 , z1 )
575- except AttributeError :
576- z0 , z1 = mtransforms .nonsingular (z0 , z1 , increasing = False ,
577- expander = 0.05 )
565+ z0 , z1 = zlocator .nonsingular (z0 , z1 )
578566 if self ._zmargin > 0 :
579567 delta = (z1 - z0 ) * self ._zmargin
580568 z0 -= delta
@@ -633,10 +621,9 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False,
633621
634622 if left == right :
635623 cbook ._warn_external (
636- ('Attempting to set identical left==right results\n '
637- 'in singular transformations; automatically expanding.\n '
638- 'left=%s, right=%s' ) % (left , right ))
639- left , right = mtransforms .nonsingular (left , right , increasing = False )
624+ f"Attempting to set identical left == right == { left } results "
625+ f"in singular transformations; automatically expanding." )
626+ left , right = self .xaxis .get_major_locator ().nonsingular (left , right )
640627 left , right = self .xaxis .limit_range_for_scale (left , right )
641628 self .xy_viewLim .intervalx = (left , right )
642629
@@ -689,12 +676,12 @@ def set_ylim3d(self, bottom=None, top=None, emit=True, auto=False,
689676 if top is None :
690677 top = old_top
691678
692- if top == bottom :
679+ if bottom == top :
693680 cbook ._warn_external (
694- ( ' Attempting to set identical bottom== top results \n '
695- ' in singular transformations; automatically expanding. \n '
696- 'bottom=%s, top=%s' ) % ( bottom , top ) )
697- bottom , top = mtransforms . nonsingular (bottom , top , increasing = False )
681+ f" Attempting to set identical bottom == top == { bottom } "
682+ f"results in singular transformations; automatically "
683+ f"expanding." )
684+ bottom , top = self . yaxis . get_major_locator (). nonsingular (bottom , top )
698685 bottom , top = self .yaxis .limit_range_for_scale (bottom , top )
699686 self .xy_viewLim .intervaly = (bottom , top )
700687
@@ -747,12 +734,12 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False,
747734 if top is None :
748735 top = old_top
749736
750- if top == bottom :
737+ if bottom == top :
751738 cbook ._warn_external (
752- ( ' Attempting to set identical bottom== top results \n '
753- ' in singular transformations; automatically expanding. \n '
754- 'bottom=%s, top=%s' ) % ( bottom , top ) )
755- bottom , top = mtransforms . nonsingular (bottom , top , increasing = False )
739+ f" Attempting to set identical bottom == top == { bottom } "
740+ f"results in singular transformations; automatically "
741+ f"expanding." )
742+ bottom , top = self . zaxis . get_major_locator (). nonsingular (bottom , top )
756743 bottom , top = self .zaxis .limit_range_for_scale (bottom , top )
757744 self .zz_viewLim .intervalx = (bottom , top )
758745
0 commit comments