MCPcopy
hub / github.com/matplotlib/matplotlib / test_axline

Function test_axline

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

Source from the content-addressed store, hash-verified

5678
5679@check_figures_equal()
5680def 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()

Callers

nothing calls this directly

Calls 6

axlineMethod · 0.80
axhlineMethod · 0.80
axvlineMethod · 0.80
subplotsMethod · 0.45
setMethod · 0.45
plotMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…