| 5636 | @image_comparison(['vline_hline_zorder.png', 'errorbar_zorder.png'], style='mpl20', |
| 5637 | tol=0.02 if sys.platform == 'darwin' else 0) |
| 5638 | def test_eb_line_zorder(): |
| 5639 | x = list(range(10)) |
| 5640 | |
| 5641 | # First illustrate basic pyplot interface, using defaults where possible. |
| 5642 | fig = plt.figure() |
| 5643 | ax = fig.gca() |
| 5644 | ax.plot(x, lw=10, zorder=5) |
| 5645 | ax.axhline(1, color='red', lw=10, zorder=1) |
| 5646 | ax.axhline(5, color='green', lw=10, zorder=10) |
| 5647 | ax.axvline(7, color='m', lw=10, zorder=7) |
| 5648 | ax.axvline(2, color='k', lw=10, zorder=3) |
| 5649 | |
| 5650 | ax.set_title("axvline and axhline zorder test") |
| 5651 | |
| 5652 | # Now switch to a more OO interface to exercise more features. |
| 5653 | fig = plt.figure() |
| 5654 | ax = fig.gca() |
| 5655 | x = list(range(10)) |
| 5656 | y = np.zeros(10) |
| 5657 | yerr = list(range(10)) |
| 5658 | ax.errorbar(x, y, yerr=yerr, zorder=5, lw=5, color='r') |
| 5659 | for j in range(10): |
| 5660 | ax.axhline(j, lw=5, color='k', zorder=j) |
| 5661 | ax.axhline(-j, lw=5, color='k', zorder=j) |
| 5662 | |
| 5663 | ax.set_title("errorbar zorder test") |
| 5664 | |
| 5665 | |
| 5666 | @check_figures_equal() |