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

Function test_legend_set_alignment

lib/matplotlib/tests/test_legend.py:812–818  ·  view source on GitHub ↗
(alignment)

Source from the content-addressed store, hash-verified

810
811@pytest.mark.parametrize('alignment', ('center', 'left', 'right'))
812def test_legend_set_alignment(alignment):
813 fig, ax = plt.subplots()
814 ax.plot(range(10), label='test')
815 leg = ax.legend()
816 leg.set_alignment(alignment)
817 assert leg.get_children()[0].align == alignment
818 assert leg.get_alignment() == alignment
819
820
821@pytest.mark.parametrize('color', ('red', 'none', (.5, .5, .5)))

Callers

nothing calls this directly

Calls 6

get_alignmentMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
legendMethod · 0.45
set_alignmentMethod · 0.45
get_childrenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…