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

Function test_subfigure_ss

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

Source from the content-addressed store, hash-verified

1399 savefig_kwarg={'facecolor': 'teal'},
1400 tol=0.022 if sys.platform == 'darwin' else 0)
1401def test_subfigure_ss():
1402 # test assigning the subfigure via subplotspec
1403 np.random.seed(19680801)
1404 fig = plt.figure(layout='constrained')
1405 gs = fig.add_gridspec(1, 2)
1406
1407 sub = fig.add_subfigure(gs[0], facecolor='pink')
1408
1409 axs = sub.subplots(2, 2)
1410 for ax in axs.flat:
1411 pc = ax.pcolormesh(np.random.randn(30, 30), vmin=-2, vmax=2)
1412 sub.colorbar(pc, ax=axs)
1413 sub.suptitle('Left Side')
1414
1415 ax = fig.add_subplot(gs[1])
1416 ax.plot(np.arange(20))
1417 ax.set_title('Axes')
1418
1419 fig.suptitle('Figure suptitle', fontsize='xx-large')
1420
1421
1422@image_comparison(['test_subfigure_double.png'], style='mpl20',

Callers

nothing calls this directly

Calls 10

figureMethod · 0.80
add_gridspecMethod · 0.80
add_subfigureMethod · 0.80
pcolormeshMethod · 0.80
suptitleMethod · 0.80
add_subplotMethod · 0.80
subplotsMethod · 0.45
colorbarMethod · 0.45
plotMethod · 0.45
set_titleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…