We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 602dfbe commit 3d9fbccCopy full SHA for 3d9fbcc
lib/matplotlib/tests/test_figure.py
@@ -546,3 +546,19 @@ def test_add_subplot_twotuple():
546
ax4 = fig.add_subplot(3, 2, (3, 6))
547
assert ax4.get_subplotspec().rowspan == range(1, 3)
548
assert ax4.get_subplotspec().colspan == range(0, 2)
549
+
550
551
+def test_reuse_gridspec():
552
+ fig = plt.figure()
553
+ ax = [None] * 9
554
+ for i in range(9):
555
+ ax[i] = fig.add_subplot(3, 3, i + 1)
556
+ for i in range(1, 9):
557
+ assert (ax[i].get_subplotspec().get_gridspec() ==
558
+ ax[0].get_subplotspec().get_gridspec())
559
560
561
+ ax1 = fig.add_subplot(3, 3, (1, 7))
562
+ ax2 = fig.add_subplot(3, 3, (6, 9))
563
+ assert (ax1.get_subplotspec().get_gridspec() ==
564
+ ax2.get_subplotspec().get_gridspec())
0 commit comments