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

Function test_stackplot_hatching

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

Source from the content-addressed store, hash-verified

3492
3493@check_figures_equal()
3494def test_stackplot_hatching(fig_ref, fig_test):
3495 x = np.linspace(0, 10, 10)
3496 y1 = 1.0 * x
3497 y2 = 2.0 * x + 1
3498 y3 = 3.0 * x + 2
3499 # stackplot with different hatching styles (issue #27146)
3500 ax_test = fig_test.subplots()
3501 ax_test.stackplot(x, y1, y2, y3, hatch=["x", "//", "\\\\"], colors=["white"])
3502 ax_test.set_xlim(0, 10)
3503 ax_test.set_ylim(0, 70)
3504 # compare with result from hatching each layer individually
3505 stack_baseline = np.zeros(len(x))
3506 ax_ref = fig_ref.subplots()
3507 ax_ref.fill_between(x, stack_baseline, y1, hatch="x", facecolor="white")
3508 ax_ref.fill_between(x, y1, y1+y2, hatch="//", facecolor="white")
3509 ax_ref.fill_between(x, y1+y2, y1+y2+y3, hatch="\\\\", facecolor="white")
3510 ax_ref.set_xlim(0, 10)
3511 ax_ref.set_ylim(0, 70)
3512
3513
3514def test_stackplot_facecolor():

Callers

nothing calls this directly

Calls 4

subplotsMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45
fill_betweenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…