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

Function test_axis_method_errors

lib/matplotlib/tests/test_axes.py:6478–6501  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6476
6477
6478def test_axis_method_errors():
6479 ax = plt.gca()
6480 with pytest.raises(ValueError, match="unknown value for which: 'foo'"):
6481 ax.get_xaxis_transform('foo')
6482 with pytest.raises(ValueError, match="unknown value for which: 'foo'"):
6483 ax.get_yaxis_transform('foo')
6484 with pytest.raises(TypeError, match="Cannot supply both positional and"):
6485 ax.set_prop_cycle('foo', label='bar')
6486 with pytest.raises(ValueError, match="argument must be among"):
6487 ax.set_anchor('foo')
6488 with pytest.raises(ValueError, match="scilimits must be a sequence"):
6489 ax.ticklabel_format(scilimits=1)
6490 with pytest.raises(TypeError, match="Specifying 'loc' is disallowed"):
6491 ax.set_xlabel('foo', loc='left', x=1)
6492 with pytest.raises(TypeError, match="Specifying 'loc' is disallowed"):
6493 ax.set_ylabel('foo', loc='top', y=1)
6494 with pytest.raises(TypeError, match="Cannot pass both 'left'"):
6495 ax.set_xlim(left=0, xmin=1)
6496 with pytest.raises(TypeError, match="Cannot pass both 'right'"):
6497 ax.set_xlim(right=0, xmax=1)
6498 with pytest.raises(TypeError, match="Cannot pass both 'bottom'"):
6499 ax.set_ylim(bottom=0, ymin=1)
6500 with pytest.raises(TypeError, match="Cannot pass both 'top'"):
6501 ax.set_ylim(top=0, ymax=1)
6502
6503
6504@pytest.mark.parametrize('twin', ('x', 'y'))

Callers

nothing calls this directly

Calls 10

gcaMethod · 0.80
ticklabel_formatMethod · 0.80
set_xlabelMethod · 0.80
set_ylabelMethod · 0.80
get_xaxis_transformMethod · 0.45
get_yaxis_transformMethod · 0.45
set_prop_cycleMethod · 0.45
set_anchorMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…