File tree 3 files changed +12
-8
lines changed
baseline_images/test_axes
3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -2962,22 +2962,16 @@ def handle_single_axis(
2962
2962
2963
2963
# Prevent margin addition from crossing a sticky value. A small
2964
2964
# tolerance must be added due to floating point issues with
2965
- # streamplot; it is defined relative to x0, x1, x1-x0 but has
2965
+ # streamplot; it is defined relative to x1-x0 but has
2966
2966
# no absolute term (e.g. "+1e-8") to avoid issues when working with
2967
2967
# datasets where all values are tiny (less than 1e-8).
2968
- tol = 1e-5 * max ( abs (x0 ), abs ( x1 ), abs ( x1 - x0 ) )
2968
+ tol = 1e-5 * abs (x1 - x0 )
2969
2969
# Index of largest element < x0 + tol, if any.
2970
2970
i0 = stickies .searchsorted (x0 + tol ) - 1
2971
2971
x0bound = stickies [i0 ] if i0 != - 1 else None
2972
- # Ensure the boundary acts only if the sticky is the extreme value
2973
- if x0bound is not None and x0bound > x0 :
2974
- x0bound = None
2975
2972
# Index of smallest element > x1 - tol, if any.
2976
2973
i1 = stickies .searchsorted (x1 - tol )
2977
2974
x1bound = stickies [i1 ] if i1 != len (stickies ) else None
2978
- # Ensure the boundary acts only if the sticky is the extreme value
2979
- if x1bound is not None and x1bound < x1 :
2980
- x1bound = None
2981
2975
2982
2976
# Add the margin in figure space and then transform back, to handle
2983
2977
# non-linear scales.
Original file line number Diff line number Diff line change @@ -701,6 +701,16 @@ def test_sticky_tolerance():
701
701
axs .flat [3 ].barh (y = 1 , width = width , left = - 20000.1 )
702
702
703
703
704
+ @image_comparison (['sticky_tolerance_cf.png' ], remove_text = True , style = "mpl20" )
705
+ def test_sticky_tolerance_contourf ():
706
+ fig , ax = plt .subplots ()
707
+
708
+ x = y = [14496.71 , 14496.75 ]
709
+ data = [[0 , 1 ], [2 , 3 ]]
710
+
711
+ ax .contourf (x , y , data )
712
+
713
+
704
714
def test_nargs_stem ():
705
715
with pytest .raises (TypeError , match = '0 were given' ):
706
716
# stem() takes 1-3 arguments.
You can’t perform that action at this time.
0 commit comments