(fig_ref, fig_test)
| 3492 | |
| 3493 | @check_figures_equal() |
| 3494 | def 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 | |
| 3514 | def test_stackplot_facecolor(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…