From 71eed55bd95d99dc32c6b3ca3f70093eb8498177 Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Fri, 25 Aug 2023 12:09:45 +0100 Subject: [PATCH] FIX: array labelcolor for Tick --- lib/matplotlib/axis.py | 2 +- lib/matplotlib/tests/test_axis.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lib/matplotlib/tests/test_axis.py 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])) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy