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

Function test_stairs_fill

lib/matplotlib/tests/test_axes.py:2699–2721  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

2697
2698@check_figures_equal()
2699def test_stairs_fill(fig_test, fig_ref):
2700 h, bins = [1, 2, 3, 4, 2], [0, 1, 2, 3, 4, 5]
2701 bs = -2
2702 # Test
2703 test_axes = fig_test.subplots(2, 2).flatten()
2704 test_axes[0].stairs(h, bins, fill=True)
2705 test_axes[1].stairs(h, bins, orientation='horizontal', fill=True)
2706 test_axes[2].stairs(h, bins, baseline=bs, fill=True)
2707 test_axes[3].stairs(h, bins, baseline=bs, orientation='horizontal',
2708 fill=True)
2709
2710 # # Ref
2711 ref_axes = fig_ref.subplots(2, 2).flatten()
2712 ref_axes[0].fill_between(bins, np.append(h, h[-1]), step='post', lw=0)
2713 ref_axes[0].set_ylim(0, None)
2714 ref_axes[1].fill_betweenx(bins, np.append(h, h[-1]), step='post', lw=0)
2715 ref_axes[1].set_xlim(0, None)
2716 ref_axes[2].fill_between(bins, np.append(h, h[-1]),
2717 np.ones(len(h)+1)*bs, step='post', lw=0)
2718 ref_axes[2].set_ylim(bs, None)
2719 ref_axes[3].fill_betweenx(bins, np.append(h, h[-1]),
2720 np.ones(len(h)+1)*bs, step='post', lw=0)
2721 ref_axes[3].set_xlim(bs, None)
2722
2723
2724@check_figures_equal()

Callers

nothing calls this directly

Calls 6

stairsMethod · 0.80
fill_betweenxMethod · 0.80
subplotsMethod · 0.45
fill_betweenMethod · 0.45
set_ylimMethod · 0.45
set_xlimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…