@@ -7811,34 +7811,26 @@ def test_ytickcolor_is_not_yticklabelcolor():
78117811 assert tick .label1 .get_color () == 'blue'
78127812
78137813
7814- def test_xticklabelcolor_if_not_xtickcolor ():
7814+ def test_xaxis_offsetText_color ():
78157815 plt .rcParams ['xtick.labelcolor' ] = 'blue'
78167816 ax = plt .axes ()
7817- ticks = ax .xaxis .get_major_ticks ()
7818- for tick in ticks :
7819- assert tick .label1 .get_color () == 'blue'
7817+ assert ax .xaxis .offsetText .get_color () == 'blue'
78207818
78217819 plt .rcParams ['xtick.color' ] = 'yellow'
78227820 plt .rcParams ['xtick.labelcolor' ] = 'inherit'
78237821 ax = plt .axes ()
7824- ticks = ax .xaxis .get_major_ticks ()
7825- for tick in ticks :
7826- assert tick .label1 .get_color () == 'yellow'
7822+ assert ax .xaxis .offsetText .get_color () == 'yellow'
78277823
78287824
7829- def test_yticklabelcolor_if_not_ytickcolor ():
7825+ def test_yaxis_offsetText_color ():
78307826 plt .rcParams ['ytick.labelcolor' ] = 'green'
78317827 ax = plt .axes ()
7832- ticks = ax .yaxis .get_major_ticks ()
7833- for tick in ticks :
7834- assert tick .label1 .get_color () == 'green'
7828+ assert ax .yaxis .offsetText .get_color () == 'green'
78357829
78367830 plt .rcParams ['ytick.color' ] = 'red'
78377831 plt .rcParams ['ytick.labelcolor' ] = 'inherit'
78387832 ax = plt .axes ()
7839- ticks = ax .yaxis .get_major_ticks ()
7840- for tick in ticks :
7841- assert tick .label1 .get_color () == 'red'
7833+ assert ax .yaxis .offsetText .get_color () == 'red'
78427834
78437835
78447836@pytest .mark .parametrize ('size' , [size for size in mfont_manager .font_scalings
0 commit comments