@@ -2857,8 +2857,8 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
2857
2857
if self .get_yscale () == 'log' :
2858
2858
y_stickies = y_stickies [y_stickies > 0 ]
2859
2859
2860
- def handle_single_axis (scale , autoscaleon , shared_axes , interval ,
2861
- minpos , axis , margin , stickies , set_bound ):
2860
+ def handle_single_axis (scale , autoscaleon , shared_axes , name ,
2861
+ axis , margin , stickies , set_bound ):
2862
2862
2863
2863
if not (scale and autoscaleon ):
2864
2864
return # nothing to do...
@@ -2870,12 +2870,16 @@ def handle_single_axis(scale, autoscaleon, shared_axes, interval,
2870
2870
x_values = []
2871
2871
minimum_minpos = np .inf
2872
2872
for ax in shared :
2873
- x_values .extend (getattr (ax .dataLim , interval ))
2873
+ x_values .extend (getattr (ax .dataLim , f" interval{ name } " ))
2874
2874
minimum_minpos = min (minimum_minpos ,
2875
- getattr (ax .dataLim , minpos ))
2875
+ getattr (ax .dataLim , f" minpos{ name } " ))
2876
2876
x_values = np .extract (np .isfinite (x_values ), x_values )
2877
2877
if x_values .size >= 1 :
2878
2878
x0 , x1 = (x_values .min (), x_values .max ())
2879
+ elif getattr (self ._viewLim , f"mutated{ name } " )():
2880
+ # No data, but explicit viewLims already set:
2881
+ # in mutatedx or mutatedy.
2882
+ return
2879
2883
else :
2880
2884
x0 , x1 = (- np .inf , np .inf )
2881
2885
# If x0 and x1 are non finite, use the locator to figure out
@@ -2919,11 +2923,11 @@ def handle_single_axis(scale, autoscaleon, shared_axes, interval,
2919
2923
# End of definition of internal function 'handle_single_axis'.
2920
2924
2921
2925
handle_single_axis (
2922
- scalex , self ._autoscaleXon , self ._shared_x_axes , 'intervalx ' ,
2923
- 'minposx' , self .xaxis , self ._xmargin , x_stickies , self .set_xbound )
2926
+ scalex , self ._autoscaleXon , self ._shared_x_axes , 'x ' ,
2927
+ self .xaxis , self ._xmargin , x_stickies , self .set_xbound )
2924
2928
handle_single_axis (
2925
- scaley , self ._autoscaleYon , self ._shared_y_axes , 'intervaly ' ,
2926
- 'minposy' , self .yaxis , self ._ymargin , y_stickies , self .set_ybound )
2929
+ scaley , self ._autoscaleYon , self ._shared_y_axes , 'y ' ,
2930
+ self .yaxis , self ._ymargin , y_stickies , self .set_ybound )
2927
2931
2928
2932
def _get_axis_list (self ):
2929
2933
return self .xaxis , self .yaxis
0 commit comments