Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 02a3d51

Browse files
authored
Merge pull request #26617 from meeseeksmachine/auto-backport-of-pr-26598-on-v3.8.x
Backport PR #26598 on branch v3.8.x (FIX: array labelcolor for Tick)
2 parents 1499f27 + e48da7e commit 02a3d51

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/matplotlib/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def __init__(
129129
if labelcolor is None:
130130
labelcolor = mpl.rcParams[f"{name}.labelcolor"]
131131

132-
if labelcolor == 'inherit':
132+
if cbook._str_equal(labelcolor, 'inherit'):
133133
# inherit from tick color
134134
labelcolor = mpl.rcParams[f"{name}.color"]
135135

lib/matplotlib/tests/test_axis.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import numpy as np
2+
3+
import matplotlib.pyplot as plt
4+
from matplotlib.axis import XTick
5+
6+
7+
def test_tick_labelcolor_array():
8+
# Smoke test that we can instantiate a Tick with labelcolor as array.
9+
ax = plt.axes()
10+
XTick(ax, 0, labelcolor=np.array([1, 0, 0, 1]))

0 commit comments

Comments
 (0)