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

Function test_axline_args

lib/matplotlib/tests/test_axes.py:5739–5756  ·  view source on GitHub ↗

Exactly one of *xy2* and *slope* must be specified.

()

Source from the content-addressed store, hash-verified

5737
5738
5739def test_axline_args():
5740 """Exactly one of *xy2* and *slope* must be specified."""
5741 fig, ax = plt.subplots()
5742 with pytest.raises(TypeError):
5743 ax.axline((0, 0)) # missing second parameter
5744 with pytest.raises(TypeError):
5745 ax.axline((0, 0), (1, 1), slope=1) # redundant parameters
5746 ax.set_xscale('log')
5747 with pytest.raises(TypeError):
5748 ax.axline((0, 0), slope=1)
5749 ax.set_xscale('linear')
5750 ax.set_yscale('log')
5751 with pytest.raises(TypeError):
5752 ax.axline((0, 0), slope=1)
5753 ax.set_yscale('linear')
5754 with pytest.raises(ValueError):
5755 ax.axline((0, 0), (0, 0)) # two identical points are not allowed
5756 plt.draw()
5757
5758
5759@image_comparison(['vlines_basic.png', 'vlines_with_nan.png', 'vlines_masked.png'],

Callers

nothing calls this directly

Calls 5

axlineMethod · 0.80
set_xscaleMethod · 0.80
subplotsMethod · 0.45
set_yscaleMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…