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

Method test_nested

lib/matplotlib/tests/test_figure.py:1081–1112  ·  view source on GitHub ↗
(self, fig_test, fig_ref)

Source from the content-addressed store, hash-verified

1079
1080 @check_figures_equal()
1081 def test_nested(self, fig_test, fig_ref):
1082
1083 fig_ref.set_layout_engine("constrained")
1084 fig_test.set_layout_engine("constrained")
1085
1086 x = [["A", "B"], ["C", "D"]]
1087
1088 y = [["F"], [x]]
1089
1090 grid_axes = fig_test.subplot_mosaic(y)
1091
1092 for k, ax in grid_axes.items():
1093 ax.set_title(k)
1094
1095 gs = fig_ref.add_gridspec(2, 1)
1096
1097 gs_n = gs[1, 0].subgridspec(2, 2)
1098
1099 axA = fig_ref.add_subplot(gs_n[0, 0])
1100 axA.set_title("A")
1101
1102 axB = fig_ref.add_subplot(gs_n[0, 1])
1103 axB.set_title("B")
1104
1105 axC = fig_ref.add_subplot(gs_n[1, 0])
1106 axC.set_title("C")
1107
1108 axD = fig_ref.add_subplot(gs_n[1, 1])
1109 axD.set_title("D")
1110
1111 axF = fig_ref.add_subplot(gs[0, 0])
1112 axF.set_title("F")
1113
1114 @check_figures_equal()
1115 def test_nested_tuple(self, fig_test, fig_ref):

Callers

nothing calls this directly

Calls 6

set_layout_engineMethod · 0.80
subplot_mosaicMethod · 0.80
add_gridspecMethod · 0.80
subgridspecMethod · 0.80
add_subplotMethod · 0.80
set_titleMethod · 0.45

Tested by

no test coverage detected