MCPcopy Index your code
hub / github.com/pydata/xarray / substring_in_axes

Function substring_in_axes

xarray/tests/test_plot.py:99–104  ·  view source on GitHub ↗

Return True if a substring is found anywhere in an axes

(substring: str, ax: mpl.axes.Axes)

Source from the content-addressed store, hash-verified

97
98
99def substring_in_axes(substring: str, ax: mpl.axes.Axes) -> bool:
100 """
101 Return True if a substring is found anywhere in an axes
102 """
103 alltxt: set[str] = {t.get_text() for t in ax.findobj(mpl.text.Text)}
104 return any(substring in txt for txt in alltxt)
105
106
107def substring_not_in_axes(substring: str, ax: mpl.axes.Axes) -> bool:

Callers 3

test_default_labelsMethod · 0.85
test_default_labelsMethod · 0.85
test_default_labelsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…