MCPcopy Create free account
hub / github.com/pydata/xarray / property_in_axes_text

Function property_in_axes_text

xarray/tests/test_plot.py:116–128  ·  view source on GitHub ↗

Return True if the specified text in an axes has the property assigned to property_str

(
    property, property_str, target_txt, ax: mpl.axes.Axes
)

Source from the content-addressed store, hash-verified

114
115
116def property_in_axes_text(
117 property, property_str, target_txt, ax: mpl.axes.Axes
118) -> bool:
119 """
120 Return True if the specified text in an axes
121 has the property assigned to property_str
122 """
123 alltxt: list[mpl.text.Text] = ax.findobj(mpl.text.Text)
124 return all(
125 plt.getp(t, property) == property_str
126 for t in alltxt
127 if t.get_text() == target_txt
128 )
129
130
131def easy_array(shape: tuple[int, ...], start: float = 0, stop: float = 1) -> np.ndarray:

Callers 1

test_title_kwargsMethod · 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…