diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index 0ace31916ca9..77bd34df69c5 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -129,7 +129,7 @@ def __init__( if labelcolor is None: labelcolor = mpl.rcParams[f"{name}.labelcolor"] - if labelcolor == 'inherit': + if cbook._str_equal(labelcolor, 'inherit'): # inherit from tick color labelcolor = mpl.rcParams[f"{name}.color"] diff --git a/lib/matplotlib/tests/test_axis.py b/lib/matplotlib/tests/test_axis.py new file mode 100644 index 000000000000..97b5f88dede1 --- /dev/null +++ b/lib/matplotlib/tests/test_axis.py @@ -0,0 +1,10 @@ +import numpy as np + +import matplotlib.pyplot as plt +from matplotlib.axis import XTick + + +def test_tick_labelcolor_array(): + # Smoke test that we can instantiate a Tick with labelcolor as array. + ax = plt.axes() + XTick(ax, 0, labelcolor=np.array([1, 0, 0, 1]))
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: