@@ -5735,7 +5735,12 @@ def test_text_labelsize():
5735
5735
ax .tick_params (direction = 'out' )
5736
5736
5737
5737
5738
- @image_comparison (['pie_default.png' ])
5738
+ # Note: The `pie` image tests were affected by Numpy 2.0 changing promotions
5739
+ # (NEP 50). While the changes were only marginal, tolerances were introduced.
5740
+ # These tolerances could likely go away when numpy 2.0 is the minimum supported
5741
+ # numpy and the images are regenerated.
5742
+
5743
+ @image_comparison (['pie_default.png' ], tol = 0.01 )
5739
5744
def test_pie_default ():
5740
5745
# The slices will be ordered and plotted counter-clockwise.
5741
5746
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5748,7 +5753,7 @@ def test_pie_default():
5748
5753
5749
5754
5750
5755
@image_comparison (['pie_linewidth_0' , 'pie_linewidth_0' , 'pie_linewidth_0' ],
5751
- extensions = ['png' ], style = 'mpl20' )
5756
+ extensions = ['png' ], style = 'mpl20' , tol = 0.01 )
5752
5757
def test_pie_linewidth_0 ():
5753
5758
# The slices will be ordered and plotted counter-clockwise.
5754
5759
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5780,7 +5785,7 @@ def test_pie_linewidth_0():
5780
5785
plt .axis ('equal' )
5781
5786
5782
5787
5783
- @image_comparison (['pie_center_radius.png' ], style = 'mpl20' )
5788
+ @image_comparison (['pie_center_radius.png' ], style = 'mpl20' , tol = 0.005 )
5784
5789
def test_pie_center_radius ():
5785
5790
# The slices will be ordered and plotted counter-clockwise.
5786
5791
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5800,7 +5805,7 @@ def test_pie_center_radius():
5800
5805
plt .axis ('equal' )
5801
5806
5802
5807
5803
- @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' )
5808
+ @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' , tol = 0.01 )
5804
5809
def test_pie_linewidth_2 ():
5805
5810
# The slices will be ordered and plotted counter-clockwise.
5806
5811
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5815,7 +5820,7 @@ def test_pie_linewidth_2():
5815
5820
plt .axis ('equal' )
5816
5821
5817
5822
5818
- @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' )
5823
+ @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' , tol = 0.01 )
5819
5824
def test_pie_ccw_true ():
5820
5825
# The slices will be ordered and plotted counter-clockwise.
5821
5826
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5830,7 +5835,7 @@ def test_pie_ccw_true():
5830
5835
plt .axis ('equal' )
5831
5836
5832
5837
5833
- @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' )
5838
+ @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' , tol = 0.002 )
5834
5839
def test_pie_frame_grid ():
5835
5840
# The slices will be ordered and plotted counter-clockwise.
5836
5841
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5857,7 +5862,7 @@ def test_pie_frame_grid():
5857
5862
plt .axis ('equal' )
5858
5863
5859
5864
5860
- @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' )
5865
+ @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' , tol = 0.009 )
5861
5866
def test_pie_rotatelabels_true ():
5862
5867
# The slices will be ordered and plotted counter-clockwise.
5863
5868
labels = 'Hogwarts' , 'Frogs' , 'Dogs' , 'Logs'
@@ -5872,7 +5877,7 @@ def test_pie_rotatelabels_true():
5872
5877
plt .axis ('equal' )
5873
5878
5874
5879
5875
- @image_comparison (['pie_no_label.png' ])
5880
+ @image_comparison (['pie_no_label.png' ], tol = 0.01 )
5876
5881
def test_pie_nolabel_but_legend ():
5877
5882
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
5878
5883
sizes = [15 , 30 , 45 , 10 ]
@@ -5886,7 +5891,7 @@ def test_pie_nolabel_but_legend():
5886
5891
plt .legend ()
5887
5892
5888
5893
5889
- @image_comparison (['pie_shadow.png' ], style = 'mpl20' )
5894
+ @image_comparison (['pie_shadow.png' ], style = 'mpl20' , tol = 0.002 )
5890
5895
def test_pie_shadow ():
5891
5896
# Also acts as a test for the shade argument of Shadow
5892
5897
sizes = [15 , 30 , 45 , 10 ]
0 commit comments