8000 Backport PR #26598: FIX: array labelcolor for Tick · matplotlib/matplotlib@7b84f26 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b84f26

Browse files
ksundenmeeseeksmachine
authored andcommitted
Backport PR #26598: FIX: array labelcolor for Tick
1 parent 923d8fb commit 7b84f26

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
@@ -122,7 +122,7 @@ def __init__(
122122
if labelcolor is None:
123123
labelcolor = mpl.rcParams[f"{name}.labelcolor"]
124124

125-
if labelcolor == 'inherit':
125+
if cbook._str_equal(labelcolor, 'inherit'):
126126
# inherit from tick color
127127
labelcolor = mpl.rcParams[f"{name}.color"]
128128

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)
0