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

Function test_legend_remove

lib/matplotlib/tests/test_legend.py:293–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

291
292
293def test_legend_remove():
294 fig, ax = plt.subplots()
295 lines = ax.plot(range(10))
296 leg = fig.legend(lines, ["test"])
297 leg.remove()
298 assert fig.legends == []
299 leg = ax.legend("test")
300 leg.remove()
301 assert ax.get_legend() is None
302
303
304def test_reverse_legend_handles_and_labels():

Callers

nothing calls this directly

Calls 5

get_legendMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
legendMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…