MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_cycle_reset

Function test_cycle_reset

lib/matplotlib/tests/test_cycles.py:129–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128
129def test_cycle_reset():
130 fig, ax = plt.subplots()
131 prop0 = StringIO()
132 prop1 = StringIO()
133 prop2 = StringIO()
134
135 with contextlib.redirect_stdout(prop0):
136 plt.getp(ax.plot([1, 2], label="label")[0])
137
138 ax.set_prop_cycle(linewidth=[10, 9, 4])
139 with contextlib.redirect_stdout(prop1):
140 plt.getp(ax.plot([1, 2], label="label")[0])
141 assert prop1.getvalue() != prop0.getvalue()
142
143 ax.set_prop_cycle(None)
144 with contextlib.redirect_stdout(prop2):
145 plt.getp(ax.plot([1, 2], label="label")[0])
146 assert prop2.getvalue() == prop0.getvalue()
147
148
149def test_invalid_input_forms():

Callers

nothing calls this directly

Calls 3

subplotsMethod · 0.45
plotMethod · 0.45
set_prop_cycleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…