@@ -652,8 +652,7 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False,
652652 if other is not self :
653653 other .set_xlim (self .xy_viewLim .intervalx ,
654654 emit = False , auto = auto )
655- if (other .figure != self .figure and
656- other .figure .canvas is not None ):
655+ if other .figure != self .figure :
657656 other .figure .canvas .draw_idle ()
658657 self .stale = True
659658 return left , right
@@ -711,8 +710,7 @@ def set_ylim3d(self, bottom=None, top=None, emit=True, auto=False,
711710 if other is not self :
712711 other .set_ylim (self .xy_viewLim .intervaly ,
713712 emit = False , auto = auto )
714- if (other .figure != self .figure and
715- other .figure .canvas is not None ):
713+ if other .figure != self .figure :
716714 other .figure .canvas .draw_idle ()
717715 self .stale = True
718716 return bottom , top
@@ -770,8 +768,7 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False,
770768 if other is not self :
771769 other .set_zlim (self .zz_viewLim .intervalx ,
772770 emit = False , auto = auto )
773- if (other .figure != self .figure and
774- other .figure .canvas is not None ):
771+ if other .figure != self .figure :
775772 other .figure .canvas .draw_idle ()
776773 self .stale = True
777774 return bottom , top
@@ -1070,17 +1067,14 @@ def mouse_init(self, rotate_btn=1, zoom_btn=3):
10701067
10711068 """
10721069 self .button_pressed = None
1073- canv = self .figure .canvas
1074- if canv is not None :
1075- c1 = canv .mpl_connect ('motion_notify_event' , self ._on_move )
1076- c2 = canv .mpl_connect ('button_press_event' , self ._button_press )
1077- c3 = canv .mpl_connect ('button_release_event' , self ._button_release )
1078- self ._cids = [c1 , c2 , c3 ]
1079- else :
1080- cbook ._warn_external ("Axes3D.figure.canvas is 'None', mouse "
1081- "rotation disabled. Set canvas then call "
1082- "Axes3D.mouse_init()." )
1083-
1070+ self ._cids = [
1071+ self .figure .canvas .mpl_connect (
1072+ 'motion_notify_event' , self ._on_move ),
1073+ self .figure .canvas .mpl_connect (
1074+ 'button_press_event' , self ._button_press ),
1075+ self .figure .canvas .mpl_connect (
1076+ 'button_release_event' , self ._button_release ),
1077+ ]
10841078 # coerce scalars into array-like, then convert into
10851079 # a regular list to avoid comparisons against None
10861080 # which breaks in recent versions of numpy.
0 commit comments