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

Function test_clabel_zorder

lib/matplotlib/tests/test_contour.py:369–383  ·  view source on GitHub ↗
(use_clabeltext, contour_zorder, clabel_zorder)

Source from the content-addressed store, hash-verified

367 [(True, 123, 1234), (False, 123, 1234),
368 (True, 123, None), (False, 123, None)])
369def test_clabel_zorder(use_clabeltext, contour_zorder, clabel_zorder):
370 x, y = np.meshgrid(np.arange(0, 10), np.arange(0, 10))
371 z = np.max(np.dstack([abs(x), abs(y)]), 2)
372
373 fig, ax = plt.subplots()
374 cs = ax.contour(x, y, z, zorder=contour_zorder)
375 clabels = cs.clabel(zorder=clabel_zorder, use_clabeltext=use_clabeltext)
376
377 if clabel_zorder is None:
378 expected_clabel_zorder = 2+contour_zorder
379 else:
380 expected_clabel_zorder = clabel_zorder
381
382 for clabel in clabels:
383 assert clabel.get_zorder() == expected_clabel_zorder
384
385
386def test_clabel_with_large_spacing():

Callers

nothing calls this directly

Calls 5

maxMethod · 0.80
get_zorderMethod · 0.80
subplotsMethod · 0.45
contourMethod · 0.45
clabelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…