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

Function test_multiple_keys

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

Source from the content-addressed store, hash-verified

166@image_comparison(['legend_multiple_keys.png'], remove_text=True, style='mpl20',
167 tol=0 if platform.machine() == 'x86_64' else 0.033)
168def test_multiple_keys():
169 # test legend entries with multiple keys
170 fig, ax = plt.subplots()
171 p1, = ax.plot([1, 2, 3], '-o')
172 p2, = ax.plot([2, 3, 4], '-x')
173 p3, = ax.plot([3, 4, 5], '-d')
174 ax.legend([(p1, p2), (p2, p1), p3], ['two keys', 'pad=0', 'one key'],
175 numpoints=1,
176 handler_map={(p1, p2): HandlerTuple(ndivide=None),
177 (p2, p1): HandlerTuple(ndivide=None, pad=0)})
178
179
180@image_comparison(['rgba_alpha.png'], remove_text=True, style='mpl20',

Callers

nothing calls this directly

Calls 4

HandlerTupleClass · 0.90
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…