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

Function test_legend_alignment

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

Source from the content-addressed store, hash-verified

781
782@pytest.mark.parametrize('alignment', ('center', 'left', 'right'))
783def test_legend_alignment(alignment):
784 fig, ax = plt.subplots()
785 ax.plot(range(10), label='test')
786 leg = ax.legend(title="Aardvark", alignment=alignment)
787 assert leg.get_children()[0].align == alignment
788 assert leg.get_alignment() == alignment
789
790
791@pytest.mark.parametrize('loc', ('center', 'best',))

Callers

nothing calls this directly

Calls 5

get_alignmentMethod · 0.80
subplotsMethod · 0.45
plotMethod · 0.45
legendMethod · 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…