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

Function test_fig_legend_set_loc

lib/matplotlib/tests/test_legend.py:801–808  ·  view source on GitHub ↗
(loc)

Source from the content-addressed store, hash-verified

799
800@pytest.mark.parametrize('loc', ('outside right', 'right',))
801def test_fig_legend_set_loc(loc):
802 fig, ax = plt.subplots()
803 ax.plot(range(10), label='test')
804 leg = fig.legend()
805 leg.set_loc(loc)
806
807 loc = loc.split()[1] if loc.startswith("outside") else loc
808 assert leg._get_loc() == mlegend.Legend.codes[loc]
809
810
811@pytest.mark.parametrize('alignment', ('center', 'left', 'right'))

Callers

nothing calls this directly

Calls 5

set_locMethod · 0.80
_get_locMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
legendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…