| 5678 | |
| 5679 | @check_figures_equal() |
| 5680 | def test_axline(fig_test, fig_ref): |
| 5681 | ax = fig_test.subplots() |
| 5682 | ax.set(xlim=(-1, 1), ylim=(-1, 1)) |
| 5683 | ax.axline((0, 0), (1, 1)) |
| 5684 | ax.axline((0, 0), (1, 0), color='C1') |
| 5685 | ax.axline((0, 0.5), (1, 0.5), color='C2') |
| 5686 | # slopes |
| 5687 | ax.axline((-0.7, -0.5), slope=0, color='C3') |
| 5688 | ax.axline((1, -0.5), slope=-0.5, color='C4') |
| 5689 | ax.axline((-0.5, 1), slope=float('inf'), color='C5') |
| 5690 | |
| 5691 | ax = fig_ref.subplots() |
| 5692 | ax.set(xlim=(-1, 1), ylim=(-1, 1)) |
| 5693 | ax.plot([-1, 1], [-1, 1]) |
| 5694 | ax.axhline(0, color='C1') |
| 5695 | ax.axhline(0.5, color='C2') |
| 5696 | # slopes |
| 5697 | ax.axhline(-0.5, color='C3') |
| 5698 | ax.plot([-1, 1], [0.5, -0.5], color='C4') |
| 5699 | ax.axvline(-0.5, color='C5') |
| 5700 | |
| 5701 | |
| 5702 | @check_figures_equal() |