@@ -2253,15 +2253,18 @@ def _init(self):
2253
2253
)
2254
2254
self .label_position = 'bottom'
2255
2255
2256
+ if mpl .rcParams ['xtick.labelcolor' ] == 'inherit' :
2257
+ tick_color = mpl .rcParams ['xtick.color' ]
2258
+ else :
2259
+ tick_color = mpl .rcParams ['xtick.labelcolor' ]
2260
+
2256
2261
self .offsetText .set (
2257
2262
x = 1 , y = 0 ,
2258
2263
verticalalignment = 'top' , horizontalalignment = 'right' ,
2259
2264
transform = mtransforms .blended_transform_factory (
2260
2265
self .axes .transAxes , mtransforms .IdentityTransform ()),
2261
2266
fontsize = mpl .rcParams ['xtick.labelsize' ],
2262
- color = mpl .rcParams ['xtick.color' ] if
2263
- mpl .rcParams ['xtick.labelcolor' ] == 'inherit' else
2264
- mpl .rcParams ['xtick.labelcolor' ],
2267
+ color = tick_color
2265
2268
)
2266
2269
self .offset_text_position = 'bottom'
2267
2270
@@ -2514,16 +2517,20 @@ def _init(self):
2514
2517
mtransforms .IdentityTransform (), self .axes .transAxes ),
2515
2518
)
2516
2519
self .label_position = 'left'
2520
+
2521
+ if mpl .rcParams ['ytick.labelcolor' ] == 'inherit' :
2522
+ tick_color = mpl .rcParams ['ytick.color' ]
2523
+ else :
2524
+ tick_color = mpl .rcParams ['ytick.labelcolor' ]
2525
+
2517
2526
# x in axes coords, y in display coords(!).
2518
2527
self .offsetText .set (
2519
2528
x = 0 , y = 0.5 ,
2520
2529
verticalalignment = 'baseline' , horizontalalignment = 'left' ,
2521
2530
transform = mtransforms .blended_transform_factory (
2522
2531
self .axes .transAxes , mtransforms .IdentityTransform ()),
2523
2532
fontsize = mpl .rcParams ['ytick.labelsize' ],
2524
- color = mpl .rcParams ['ytick.color' ] if
2525
- mpl .rcParams ['ytick.labelcolor' ] == 'inherit' else
2526
- mpl .rcParams ['ytick.labelcolor' ],
2533
+ color = tick_color
2527
2534
)
2528
2535
self .offset_text_position = 'left'
2529
2536
0 commit comments