8000 Merge pull request #26616 from meeseeksmachine/auto-backport-of-pr-26… · matplotlib/matplotlib@3c98167 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c98167

Browse files
authored
Merge pull request #26616 from meeseeksmachine/auto-backport-of-pr-26598-on-v3.7.x
Backport PR #26598 on branch v3.7.x (FIX: array labelcolor for Tick)
2 parents 923d8fb + 7b84f26 commit 3c98167

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