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

Function test_striped_lines

lib/matplotlib/tests/test_collections.py:1385–1404  ·  view source on GitHub ↗
(fig_test, fig_ref, gapcolor)

Source from the content-addressed store, hash-verified

1383@pytest.mark.parametrize('gapcolor', ['orange', ['r', 'k']])
1384@check_figures_equal()
1385def test_striped_lines(fig_test, fig_ref, gapcolor):
1386 ax_test = fig_test.add_subplot(111)
1387 ax_ref = fig_ref.add_subplot(111)
1388
1389 for ax in [ax_test, ax_ref]:
1390 ax.set_xlim(0, 6)
1391 ax.set_ylim(0, 1)
1392
1393 x = range(1, 6)
1394 linestyles = [':', '-', '--']
1395
1396 ax_test.vlines(x, 0, 1, linewidth=20, linestyle=linestyles, gapcolor=gapcolor,
1397 alpha=0.5)
1398
1399 if isinstance(gapcolor, str):
1400 gapcolor = [gapcolor]
1401
1402 for x, gcol, ls in zip(x, itertools.cycle(gapcolor),
1403 itertools.cycle(linestyles)):
1404 ax_ref.axvline(x, 0, 1, linewidth=20, linestyle=ls, gapcolor=gcol, alpha=0.5)
1405
1406
1407@check_figures_equal(extensions=['png', 'pdf', 'svg', 'eps'])

Callers

nothing calls this directly

Calls 5

add_subplotMethod · 0.80
vlinesMethod · 0.80
axvlineMethod · 0.80
set_xlimMethod · 0.45
set_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…