@@ -7811,34 +7811,26 @@ def test_ytickcolor_is_not_yticklabelcolor():
7811
7811
assert tick .label1 .get_color () == 'blue'
7812
7812
7813
7813
7814
- def test_xticklabelcolor_if_not_xtickcolor ():
7814
+ def test_xaxis_offsetText_color ():
7815
7815
plt .rcParams ['xtick.labelcolor' ] = 'blue'
7816
7816
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'
7820
7818
7821
7819
plt .rcParams ['xtick.color' ] = 'yellow'
7822
7820
plt .rcParams ['xtick.labelcolor' ] = 'inherit'
7823
7821
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'
7827
7823
7828
7824
7829
- def test_yticklabelcolor_if_not_ytickcolor ():
7825
+ def test_yaxis_offsetText_color ():
7830
7826
plt .rcParams ['ytick.labelcolor' ] = 'green'
7831
7827
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'
7835
7829
7836
7830
plt .rcParams ['ytick.color' ] = 'red'
7837
7831
plt .rcParams ['ytick.labelcolor' ] = 'inherit'
7838
7832
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'
7842
7834
7843
7835
7844
7836
@pytest .mark .parametrize ('size' , [size for size in mfont_manager .font_scalings
0 commit comments