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

Function test_invalid_figure_add_axes

lib/matplotlib/tests/test_figure.py:559–582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

557
558
559def test_invalid_figure_add_axes():
560 fig = plt.figure()
561 with pytest.raises(TypeError,
562 match="missing 1 required positional argument: 'rect'"):
563 fig.add_axes()
564
565 with pytest.raises(ValueError):
566 fig.add_axes((.1, .1, .5, np.nan))
567
568 with pytest.raises(TypeError, match="multiple values for argument 'rect'"):
569 fig.add_axes((0, 0, 1, 1), rect=[0, 0, 1, 1])
570
571 fig2, ax = plt.subplots()
572 with pytest.raises(ValueError,
573 match="The Axes must have been created in the present "
574 "figure"):
575 fig.add_axes(ax)
576
577 fig2.delaxes(ax)
578 with pytest.raises(TypeError, match=r"add_axes\(\) takes 1 positional arguments"):
579 fig2.add_axes(ax, "extra positional argument")
580
581 with pytest.raises(TypeError, match=r"add_axes\(\) takes 1 positional arguments"):
582 fig.add_axes((0, 0, 1, 1), "extra positional argument")
583
584
585def test_subplots_shareax_loglabels():

Callers

nothing calls this directly

Calls 4

figureMethod · 0.80
add_axesMethod · 0.80
delaxesMethod · 0.80
subplotsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…