@@ -5743,7 +5743,12 @@ def test_text_labelsize():
5743
5743
ax .tick_params (direction = 'out' )
5744
5744
5745
5745
5746
- @image_comparison (['pie_default.png' ])
5746
+ # Note: The `pie` image tests were affected by Numpy 2.0 changing promotions
5747
+ # (NEP 50). While the changes were only marginal, tolerances were introduced.
5748
+ # These tolerances could likely go away when numpy 2.0 is the minimum supported
5749
+ # numpy and the images are regenerated.
5750
+
5751
+ @image_comparison (['pie_default.png' ], tol = 0.01 )
5747
5752
def test_pie_default ():
5748
5753
# The slices will be ordered and plotted counter-clockwise.
5749
5754
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5756,7 +5761,7 @@ def test_pie_default():
5756
5761
5757
5762
5758
5763
@image_comparison (['pie_linewidth_0' , 'pie_linewidth_0' , 'pie_linewidth_0' ],
5759
- extensions = ['png' ], style = 'mpl20' )
5764
+ extensions = ['png' ], style = 'mpl20' , tol = 0.01 )
5760
5765
def test_pie_linewidth_0 ():
5761
5766
# The slices will be ordered and plotted counter-clockwise.
5762
5767
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5788,7 +5793,7 @@ def test_pie_linewidth_0():
5788
5793
plt .axis ('equal' )
5789
5794
5790
5795
5791
- @image_comparison (['pie_center_radius.png' ], style = 'mpl20' )
5796
+ @image_comparison (['pie_center_radius.png' ], style = 'mpl20' , tol = 0.005 )
5792
5797
def test_pie_center_radius ():
5793
5798
# The slices will be ordered and plotted counter-clockwise.
5794
5799
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5808,7 +5813,7 @@ def test_pie_center_radius():
5808
5813
plt .axis ('equal' )
5809
5814
5810
5815
5811
- @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' )
5816
+ @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' , tol = 0.01 )
5812
5817
def test_pie_linewidth_2 ():
5813
5818
# The slices will be ordered and plotted counter-clockwise.
5814
5819
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5823,7 +5828,7 @@ def test_pie_linewidth_2():
5823
5828
plt .axis ('equal' )
5824
5829
5825
5830
5826
- @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' )
5831
+ @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' , tol = 0.01 )
5827
5832
def test_pie_ccw_true ():
5828
5833
# The slices will be ordered and plotted counter-clockwise.
5829
5834
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5838,7 +5843,7 @@ def test_pie_ccw_true():
5838
5843
plt .axis ('equal' )
5839
5844
5840
5845
5841
- @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' )
5846
+ @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' , tol = 0.002 )
5842
5847
def test_pie_frame_grid ():
5843
5848
# The slices will be ordered and plotted counter-clockwise.
5844
5849
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -5865,7 +5870,7 @@ def test_pie_frame_grid():
5865
5870
plt .axis ('equal' )
5866
5871
5867
5872
5868
- @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' )
5873
+ @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' , tol = 0.009 )
5869
5874
def test_pie_rotatelabels_true ():
5870
5875
# The slices will be ordered and plotted counter-clockwise.
5871
5876
labels = 'Hogwarts' , 'Frogs' , 'Dogs' , 'Logs'
@@ -5880,7 +5885,7 @@ def test_pie_rotatelabels_true():
5880
5885
plt .axis ('equal' )
5881
5886
5882
5887
5883
- @image_comparison (['pie_no_label.png' ])
5888
+ @image_comparison (['pie_no_label.png' ], tol = 0.01 )
5884
5889
def test_pie_nolabel_but_legend ():
5885
5890
labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
5886
5891
sizes = [15 , 30 , 45 , 10 ]
@@ -5894,7 +5899,7 @@ def test_pie_nolabel_but_legend():
5894
5899
plt .legend ()
5895
5900
5896
5901
5897
- @image_comparison (['pie_shadow.png' ], style = 'mpl20' )
5902
+ @image_comparison (['pie_shadow.png' ], style = 'mpl20' , tol = 0.002 )
5898
5903
def test_pie_shadow ():
5899
5904
# Also acts as a test for the shade argument of Shadow
5900
5905
sizes = [15 , 30 , 45 , 10 ]
0 commit comments