@@ -741,8 +741,6 @@ def cla(self):
741741
742742 self .xaxis .cla ()
743743 self .yaxis .cla ()
744- self .set_xscale ('linear' )
745- self .set_yscale ('linear' )
746744
747745 self .ignore_existing_data_limits = True
748746 self .callbacks = cbook .CallbackRegistry (('xlim_changed' , 'ylim_changed' ))
@@ -768,6 +766,8 @@ def cla(self):
768766 self .collections = [] # collection.Collection instances
769767
770768 self ._autoscaleon = True
769+ self .set_xscale ('linear' )
770+ self .set_yscale ('linear' )
771771
772772 self .grid (self ._gridOn )
773773 props = font_manager .FontProperties (size = rcParams ['axes.titlesize' ])
@@ -1654,6 +1654,7 @@ def get_xscale(self):
16541654 ", " .join (mscale .get_scale_names ()))
16551655 return self .xaxis .get_scale ()
16561656
1657+ # MGDTODO: Update docstring
16571658 def set_xscale (self , value , ** kwargs ):
16581659 """
16591660 SET_XSCALE(value)
@@ -1673,6 +1674,7 @@ def set_xscale(self, value, **kwargs):
16731674 ACCEPTS: [%(scale)s]
16741675 """ % {'scale' : ' | ' .join ([repr (x ) for x in mscale .get_scale_names ()])}
16751676 self .xaxis .set_scale (value , ** kwargs )
1677+ self .autoscale_view ()
16761678 self ._update_transScale ()
16771679
16781680 def get_xticks (self , minor = False ):
@@ -1833,6 +1835,7 @@ def set_yscale(self, value, **kwargs):
18331835 ACCEPTS: %(scale)s
18341836 """ % {'scale' : ' | ' .join ([repr (x ) for x in mscale .get_scale_names ()])}
18351837 self .yaxis .set_scale (value , ** kwargs )
1838+ self .autoscale_view ()
18361839 self ._update_transScale ()
18371840
18381841 def get_yticks (self , minor = False ):
@@ -1992,6 +1995,7 @@ def start_pan(self, x, y, button):
19921995 lim = self .viewLim .frozen (),
19931996 trans = self .transData .frozen (),
19941997 trans_inverse = self .transData .inverted ().frozen (),
1998+ bbox = self .bbox .frozen (),
19951999 x = x ,
19962000 y = y
19972001 )
@@ -2044,9 +2048,11 @@ def format_deltas(key, dx, dy):
20442048 p = self ._pan_start
20452049 dx = x - p .x
20462050 dy = y - p .y
2051+ if dx == 0 and dy == 0 :
2052+ return
20472053 if button == 1 :
20482054 dx , dy = format_deltas (key , dx , dy )
2049- result = self .bbox . frozen () .translated (- dx , - dy ) \
2055+ result = p .bbox .translated (- dx , - dy ) \
20502056 .transformed (p .trans_inverse )
20512057 elif button == 3 :
20522058 try :
0 commit comments