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

Function test_add_subplot_twotuple

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

Source from the content-addressed store, hash-verified

982
983
984def test_add_subplot_twotuple():
985 fig = plt.figure()
986 ax1 = fig.add_subplot(3, 2, (3, 5))
987 assert ax1.get_subplotspec().rowspan == range(1, 3)
988 assert ax1.get_subplotspec().colspan == range(0, 1)
989 ax2 = fig.add_subplot(3, 2, (4, 6))
990 assert ax2.get_subplotspec().rowspan == range(1, 3)
991 assert ax2.get_subplotspec().colspan == range(1, 2)
992 ax3 = fig.add_subplot(3, 2, (3, 6))
993 assert ax3.get_subplotspec().rowspan == range(1, 3)
994 assert ax3.get_subplotspec().colspan == range(0, 2)
995 ax4 = fig.add_subplot(3, 2, (4, 5))
996 assert ax4.get_subplotspec().rowspan == range(1, 3)
997 assert ax4.get_subplotspec().colspan == range(0, 2)
998 with pytest.raises(IndexError):
999 fig.add_subplot(3, 2, (6, 3))
1000
1001
1002@image_comparison(['tightbbox_box_aspect.svg'], style='mpl20',

Callers

nothing calls this directly

Calls 3

figureMethod · 0.80
add_subplotMethod · 0.80
get_subplotspecMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…