Skip to content

Commit f92c4bd

Browse files
committed
DOC: show subfigures in mosaic tutorial!
1 parent e9cfec7 commit f92c4bd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tutorials/provisional/mosaic.py

+13
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,19 @@ def identify_axes(ax_dict, fontsize=48):
243243
)
244244
identify_axes(axd)
245245

246+
###############################################################################
247+
# Alternatively, you can use the sub-Figure functionality:
248+
249+
mosaic = """AA
250+
BC"""
251+
fig = plt.figure(constrained_layout=True)
252+
left, right = fig.subfigures(nrows=1, ncols=2)
253+
axd = left.subplot_mosaic(mosaic)
254+
identify_axes(axd)
255+
256+
axd = right.subplot_mosaic(mosaic)
257+
identify_axes(axd)
258+
246259

247260
###############################################################################
248261
# We can also pass through arguments used to create the subplots

0 commit comments

Comments
 (0)