MCPcopy
hub / github.com/matplotlib/matplotlib / test_reused_gridspec

Function test_reused_gridspec

lib/matplotlib/tests/test_figure.py:1333–1345  ·  view source on GitHub ↗

Test that these all use the same gridspec

()

Source from the content-addressed store, hash-verified

1331
1332
1333def test_reused_gridspec():
1334 """Test that these all use the same gridspec"""
1335 fig = plt.figure()
1336 ax1 = fig.add_subplot(3, 2, (3, 5))
1337 ax2 = fig.add_subplot(3, 2, 4)
1338 ax3 = plt.subplot2grid((3, 2), (2, 1), colspan=2, fig=fig)
1339
1340 gs1 = ax1.get_subplotspec().get_gridspec()
1341 gs2 = ax2.get_subplotspec().get_gridspec()
1342 gs3 = ax3.get_subplotspec().get_gridspec()
1343
1344 assert gs1 == gs2
1345 assert gs1 == gs3
1346
1347
1348@image_comparison(['test_subfigure.png'], style='mpl20',

Callers

nothing calls this directly

Calls 4

figureMethod · 0.80
add_subplotMethod · 0.80
get_gridspecMethod · 0.45
get_subplotspecMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…