You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rcParams["axes.titlecolor"] defaults to "auto", i.e. use text.color. On the other hand rcParams["axes.labelcolor"] (the color of the x/ylabels) defaults to "black", i.e. changing rcParams["text.color"] doesn't affect these labels).
Proposed solution
Add support for rcParams["axes.labelcolor"] = "auto", meaning to use the default text color, and make that the default rc value.
For bonus points: rcParams["x/ytick.labelcolor"] currently defaults to "inherit", which means to use the tick color. If we change here the spelling of "use the fallback" to "auto" (#28154), we could use that to also make "auto" mean "use rcParams["text.default"]" instead of rcParams["xtick.color"], which seems actually more consistent, especially if we also switch the rcParams["x/ytick.color"] to defaulting to the defaulf spines color (rcParams["axes.edgecolor"]) -- again, making the tick colors match the spine colors seems more important, to me, than making the tick colors and the ticklabel colors match by default, but ymmv.
The text was updated successfully, but these errors were encountered:
Hi @anntzer, would it make sense to provide support for "auto" in Text.set_color()? Something like this:
--- a/lib/matplotlib/text.py+++ b/lib/matplotlib/text.py@@ -987,11 +987,11 @@ class Text(Artist):
----------
color : :mpltype:`color`
"""
- # "auto" is only supported by axisartist, but we can just let it error- # out at draw time for simplicity.- if not cbook._str_equal(color, "auto"):- mpl.colors._check_color_like(color=color)- self._color = color+ if color == None or cbook._str_lower_equal(color, "auto"):+ self._color = mpl.rcParams["text.color"]+ else:+ self._color = color+ mpl.colors._check_color_like(color=color)
self.stale = True
Whereas, supporting label.set_color("auto"), label.set_color(None), etc. could make it easier if we wanted to change the default in the future, and could simplify the code.
Problem
rcParams["axes.titlecolor"] defaults to "auto", i.e. use text.color. On the other hand rcParams["axes.labelcolor"] (the color of the x/ylabels) defaults to "black", i.e. changing rcParams["text.color"] doesn't affect these labels).
Proposed solution
Add support for rcParams["axes.labelcolor"] = "auto", meaning to use the default text color, and make that the default rc value.
For bonus points: rcParams["x/ytick.labelcolor"] currently defaults to "inherit", which means to use the tick color. If we change here the spelling of "use the fallback" to "auto" (#28154), we could use that to also make "auto" mean "use rcParams["text.default"]" instead of rcParams["xtick.color"], which seems actually more consistent, especially if we also switch the rcParams["x/ytick.color"] to defaulting to the defaulf spines color (rcParams["axes.edgecolor"]) -- again, making the tick colors match the spine colors seems more important, to me, than making the tick colors and the ticklabel colors match by default, but ymmv.
The text was updated successfully, but these errors were encountered: