8000 TST: add a test · matplotlib/matplotlib@5a3ba09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a3ba09

Browse files
committed
TST: add a test
1 parent ab3f95a commit 5a3ba09

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/matplotlib/tests/test_figure.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,3 +579,19 @@ def test_add_subplot_twotuple():
579579
ax4 = fig.add_subplot(3, 2, (3, 6))
580580
assert ax4.get_subplotspec().rowspan == range(1, 3)
581581
assert ax4.get_subplotspec().colspan == range(0, 2)
582+
583+
584+
def test_reuse_gridspec():
585+
fig = plt.figure()
586+
ax = [None] * 9
587+
for i in range(9):
588+
ax[i] = fig.add_subplot(3, 3, i + 1)
589+
for i in range(1, 9):
590+
assert (ax[i].get_subplotspec().get_gridspec() ==
591+
ax[0].get_subplotspec().get_gridspec())
592+
593+
fig = plt.figure()
594+
ax1 = fig.add_subplot(3, 3, (1, 7))
595+
ax2 = fig.add_subplot(3, 3, (6, 9))
596+
assert (ax1.get_subplotspec().get_gridspec() ==
597+
ax2.get_subplotspec().get_gridspec())

0 commit comments

Comments
 (0)
0