@@ -2863,8 +2863,8 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
28632863 if self .get_yscale () == 'log' :
28642864 y_stickies = y_stickies [y_stickies > 0 ]
28652865
2866- def handle_single_axis (scale , autoscaleon , shared_axes , interval ,
2867- minpos , axis , margin , stickies , set_bound ):
2866+ def handle_single_axis (scale , autoscaleon , shared_axes , name ,
2867+ axis , margin , stickies , set_bound ):
28682868
28692869 if not (scale and autoscaleon ):
28702870 return # nothing to do...
@@ -2876,12 +2876,16 @@ def handle_single_axis(scale, autoscaleon, shared_axes, interval,
28762876 x_values = []
28772877 minimum_minpos = np .inf
28782878 for ax in shared :
2879- x_values .extend (getattr (ax .dataLim , interval ))
2879+ x_values .extend (getattr (ax .dataLim , f" interval{ name } " ))
28802880 minimum_minpos = min (minimum_minpos ,
2881- getattr (ax .dataLim , minpos ))
2881+ getattr (ax .dataLim , f" minpos{ name } " ))
28822882 x_values = np .extract (np .isfinite (x_values ), x_values )
28832883 if x_values .size >= 1 :
28842884 x0 , x1 = (x_values .min (), x_values .max ())
2885+ elif getattr (self ._viewLim , f"mutated{ name } " )():
2886+ # No data, but explicit viewLims already set:
2887+ # in mutatedx or mutatedy.
2888+ return
28852889 else :
28862890 x0 , x1 = (- np .inf , np .inf )
28872891 # If x0 and x1 are non finite, use the locator to figure out
@@ -2925,11 +2929,11 @@ def handle_single_axis(scale, autoscaleon, shared_axes, interval,
29252929 # End of definition of internal function 'handle_single_axis'.
29262930
29272931 handle_single_axis (
2928- scalex , self ._autoscaleXon , self ._shared_x_axes , 'intervalx ' ,
2929- 'minposx' , self .xaxis , self ._xmargin , x_stickies , self .set_xbound )
2932+ scalex , self ._autoscaleXon , self ._shared_x_axes , 'x ' ,
2933+ self .xaxis , self ._xmargin , x_stickies , self .set_xbound )
29302934 handle_single_axis (
2931- scaley , self ._autoscaleYon , self ._shared_y_axes , 'intervaly ' ,
2932- 'minposy' , self .yaxis , self ._ymargin , y_stickies , self .set_ybound )
2935+ scaley , self ._autoscaleYon , self ._shared_y_axes , 'y ' ,
2936+ self .yaxis , self ._ymargin , y_stickies , self .set_ybound )
29332937
29342938 def _get_axis_list (self ):
29352939 return self .xaxis , self .yaxis
0 commit comments