@@ -239,9 +239,8 @@ def test_matshow(fig_test, fig_ref):
239239 ax_ref .xaxis .set_ticks_position ('both' )
240240
241241
242- # TODO: tighten tolerance after baseline image is regenerated for text overhaul
243242@image_comparison ([f'formatter_ticker_{ i :03d} .png' for i in range (1 , 6 )], style = 'mpl20' ,
244- tol = 0.02 if platform . machine () == 'x86_64 ' else 0.04 )
243+ tol = 0.03 if sys . platform == 'darwin ' else 0 )
245244def test_formatter_ticker ():
246245 import matplotlib .testing .jpl_units as units
247246 units .register ()
@@ -811,8 +810,7 @@ def test_annotate_signature():
811810 assert p1 == p2
812811
813812
814- # TODO: tighten tolerance after baseline image is regenerated for text overhaul
815- @image_comparison (['fill_units.png' ], savefig_kwarg = {'dpi' : 60 }, style = 'mpl20' , tol = 0.2 )
813+ @image_comparison (['fill_units.png' ], savefig_kwarg = {'dpi' : 60 }, style = 'mpl20' )
816814def test_fill_units ():
817815 import matplotlib .testing .jpl_units as units
818816 units .register ()
@@ -951,7 +949,7 @@ def test_axvspan_epoch():
951949 ax .set_xlim (t0 - 5.0 * dt , tf + 5.0 * dt )
952950
953951
954- @image_comparison (['axhspan_epoch.png' ], style = 'mpl20' , tol = 0.02 )
952+ @image_comparison (['axhspan_epoch.png' ], style = 'mpl20' )
955953def test_axhspan_epoch ():
956954 import matplotlib .testing .jpl_units as units
957955 units .register ()
@@ -1515,8 +1513,7 @@ def test_pcolormesh_log_scale(fig_test, fig_ref):
15151513 ax .set_xscale ('log' )
15161514
15171515
1518- # TODO: tighten tolerance after baseline image is regenerated for text overhaul
1519- @image_comparison (['pcolormesh_datetime_axis.png' ], style = 'mpl20' , tol = 0.3 )
1516+ @image_comparison (['pcolormesh_datetime_axis.png' ], style = 'mpl20' )
15201517def test_pcolormesh_datetime_axis ():
15211518 fig = plt .figure ()
15221519 fig .subplots_adjust (hspace = 0.4 , top = 0.98 , bottom = .15 )
@@ -1541,8 +1538,7 @@ def test_pcolormesh_datetime_axis():
15411538 label .set_rotation (30 )
15421539
15431540
1544- # TODO: tighten tolerance after baseline image is regenerated for text overhaul
1545- @image_comparison (['pcolor_datetime_axis.png' ], style = 'mpl20' , tol = 0.3 )
1541+ @image_comparison (['pcolor_datetime_axis.png' ], style = 'mpl20' )
15461542def test_pcolor_datetime_axis ():
15471543 fig = plt .figure ()
15481544 fig .subplots_adjust (hspace = 0.4 , top = 0.98 , bottom = .15 )
@@ -1852,12 +1848,8 @@ def test_markevery():
18521848 ax .legend ()
18531849
18541850
1855- @image_comparison (['markevery_line.png' ], remove_text = True , style = 'mpl20' , tol = 0.005 )
1851+ @image_comparison (['markevery_line.png' ], remove_text = True , style = 'mpl20' )
18561852def test_markevery_line ():
1857- # TODO: a slight change in rendering between Inkscape versions may explain
1858- # why one had to introduce a small non-zero tolerance for the SVG test
1859- # to pass. One may try to remove this hack once Travis' Inkscape version
1860- # is modern enough. FWIW, no failure with 0.92.3 on my computer (#11358).
18611853 x = np .linspace (0 , 10 , 100 )
18621854 y = np .sin (x ) * np .sqrt (x / 10 + 0.5 )
18631855
@@ -2778,8 +2770,7 @@ def test_stairs_options():
27782770 ax .legend (loc = 0 )
27792771
27802772
2781- # TODO: tighten tolerance after baseline image is regenerated for text overhaul
2782- @image_comparison (['test_stairs_datetime.png' ], style = 'mpl20' , tol = 0.2 )
2773+ @image_comparison (['test_stairs_datetime.png' ], style = 'mpl20' )
27832774def test_stairs_datetime ():
27842775 f , ax = plt .subplots (constrained_layout = True )
27852776 ax .stairs (np .arange (36 ),
@@ -3403,8 +3394,7 @@ def test_log_scales_invalid():
34033394
34043395
34053396@image_comparison (['stackplot_test_image.png' , 'stackplot_test_image.png' ],
3406- style = 'mpl20' ,
3407- tol = 0 if platform .machine () == 'x86_64' else 0.031 )
3397+ style = 'mpl20' )
34083398def test_stackplot ():
34093399 fig = plt .figure ()
34103400 x = np .linspace (0 , 10 , 10 )
@@ -3565,10 +3555,7 @@ def test_bxp_horizontal():
35653555 _bxp_test_helper (bxp_kwargs = dict (orientation = 'horizontal' ))
35663556
35673557
3568- @image_comparison (['bxp_with_ylabels.png' ],
3569- savefig_kwarg = {'dpi' : 40 },
3570- style = 'default' ,
3571- tol = 0.1 )
3558+ @image_comparison (['bxp_with_ylabels.png' ], savefig_kwarg = {'dpi' : 40 }, style = 'default' )
35723559def test_bxp_with_ylabels ():
35733560 def transform (stats ):
35743561 for s , label in zip (stats , list ('ABCD' )):
@@ -3769,7 +3756,7 @@ def test_bxp_bad_capwidths():
37693756 _bxp_test_helper (bxp_kwargs = dict (capwidths = [1 ]))
37703757
37713758
3772- @image_comparison (['boxplot.png' , 'boxplot.png' ], tol = 1.28 , style = 'default' )
3759+ @image_comparison (['boxplot.png' , 'boxplot.png' ], tol = 0.43 , style = 'default' )
37733760def test_boxplot ():
37743761 # Randomness used for bootstrapping.
37753762 np .random .seed (937 )
@@ -5551,7 +5538,7 @@ def test_marker_styles():
55515538
55525539
55535540@image_comparison (['rc_markerfill.png' ], style = 'mpl20' ,
5554- tol = 0 if platform . machine () == 'x86_64 ' else 0.037 )
5541+ tol = 0.033 if sys . platform == 'darwin ' else 0 )
55555542def test_markers_fillstyle_rcparams ():
55565543 fig , ax = plt .subplots ()
55575544 x = np .arange (7 )
@@ -5574,7 +5561,7 @@ def test_vertex_markers():
55745561
55755562
55765563@image_comparison (['vline_hline_zorder.png' , 'errorbar_zorder.png' ], style = 'mpl20' ,
5577- tol = 0 if platform . machine () == 'x86_64 ' else 0.026 )
5564+ tol = 0.02 if sys . platform == 'darwin ' else 0 )
55785565def test_eb_line_zorder ():
55795566 x = list (range (10 ))
55805567
@@ -6487,12 +6474,7 @@ def test_text_labelsize():
64876474 ax .tick_params (direction = 'out' )
64886475
64896476
6490- # Note: The `pie` image tests were affected by Numpy 2.0 changing promotions
6491- # (NEP 50). While the changes were only marginal, tolerances were introduced.
6492- # These tolerances could likely go away when numpy 2.0 is the minimum supported
6493- # numpy and the images are regenerated.
6494-
6495- @image_comparison (['pie_default.png' ], style = 'mpl20' , tol = 0.01 )
6477+ @image_comparison (['pie_default.png' ], style = 'mpl20' )
64966478def test_pie_default ():
64976479 # The slices will be ordered and plotted counter-clockwise.
64986480 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -6505,7 +6487,7 @@ def test_pie_default():
65056487
65066488
65076489@image_comparison (['pie_linewidth_0.png' , 'pie_linewidth_0.png' , 'pie_linewidth_0.png' ],
6508- style = 'mpl20' , tol = 0.01 )
6490+ style = 'mpl20' )
65096491def test_pie_linewidth_0 ():
65106492 # The slices will be ordered and plotted counter-clockwise.
65116493 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -6537,7 +6519,8 @@ def test_pie_linewidth_0():
65376519 plt .axis ('equal' )
65386520
65396521
6540- @image_comparison (['pie_center_radius.png' ], style = 'mpl20' , tol = 0.011 )
6522+ @image_comparison (['pie_center_radius.png' ], style = 'mpl20' ,
6523+ tol = 0.01 if sys .platform == 'darwin' else 0 )
65416524def test_pie_center_radius ():
65426525 # The slices will be ordered and plotted counter-clockwise.
65436526 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -6557,7 +6540,7 @@ def test_pie_center_radius():
65576540 plt .axis ('equal' )
65586541
65596542
6560- @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' , tol = 0.01 )
6543+ @image_comparison (['pie_linewidth_2.png' ], style = 'mpl20' )
65616544def test_pie_linewidth_2 ():
65626545 # The slices will be ordered and plotted counter-clockwise.
65636546 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -6572,7 +6555,7 @@ def test_pie_linewidth_2():
65726555 plt .axis ('equal' )
65736556
65746557
6575- @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' , tol = 0.01 )
6558+ @image_comparison (['pie_ccw_true.png' ], style = 'mpl20' )
65766559def test_pie_ccw_true ():
65776560 # The slices will be ordered and plotted counter-clockwise.
65786561 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -6587,7 +6570,7 @@ def test_pie_ccw_true():
65876570 plt .axis ('equal' )
65886571
65896572
6590- @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' , tol = 0.002 )
6573+ @image_comparison (['pie_frame_grid.png' ], style = 'mpl20' )
65916574def test_pie_frame_grid ():
65926575 # The slices will be ordered and plotted counter-clockwise.
65936576 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
@@ -6614,8 +6597,7 @@ def test_pie_frame_grid():
66146597 plt .axis ('equal' )
66156598
66166599
6617- # TODO: tighten tolerance after baseline image is regenerated for text overhaul
6618- @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' , tol = 0.1 )
6600+ @image_comparison (['pie_rotatelabels_true.png' ], style = 'mpl20' )
66196601def test_pie_rotatelabels_true ():
66206602 # The slices will be ordered and plotted counter-clockwise.
66216603 labels = 'Hogwarts' , 'Frogs' , 'Dogs' , 'Logs'
@@ -6630,7 +6612,7 @@ def test_pie_rotatelabels_true():
66306612 plt .axis ('equal' )
66316613
66326614
6633- @image_comparison (['pie_no_label.png' ], style = 'mpl20' , tol = 0.01 )
6615+ @image_comparison (['pie_no_label.png' ], style = 'mpl20' )
66346616def test_pie_nolabel_but_legend ():
66356617 labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
66366618 sizes = [15 , 30 , 45 , 10 ]
@@ -8356,7 +8338,7 @@ def inverted(self):
83568338
83578339
83588340@image_comparison (['secondary_xy.png' ], style = 'mpl20' ,
8359- tol = 0 if platform .machine () == 'x86_64' else 0.027 )
8341+ tol = 0 if platform .machine () == 'x86_64' else 0.024 )
83608342def test_secondary_xy ():
83618343 fig , axs = plt .subplots (1 , 2 , figsize = (10 , 5 ), constrained_layout = True )
83628344
@@ -9648,7 +9630,7 @@ def test_zorder_and_explicit_rasterization():
96489630
96499631
96509632@image_comparison (["preset_clip_paths.png" ], remove_text = True , style = "mpl20" ,
9651- tol = 0 if platform . machine () == 'x86_64 ' else 0.027 )
9633+ tol = 0.01 if sys . platform == 'darwin ' else 0 )
96529634def test_preset_clip_paths ():
96539635 fig , ax = plt .subplots ()
96549636
0 commit comments