@@ -105,7 +105,7 @@ def identify_axes(ax_dict, fontsize=48):
105
105
# String short-hand
106
106
# =================
107
107
#
108
- # By restricting our axes labels to single characters we can use Using we can
108
+ # By restricting our axes labels to single characters we can
109
109
# "draw" the Axes we want as "ASCII art". The following
110
110
111
111
@@ -123,14 +123,30 @@ def identify_axes(ax_dict, fontsize=48):
123
123
ax_dict = fig .subplot_mosaic (mosaic )
124
124
identify_axes (ax_dict )
125
125
126
+ ###############################################################################
127
+ # Alternatively, you can use the more compact string notation
128
+ mosaic = "AB;CD"
129
+
130
+ ###############################################################################
131
+ # will give you the same composition, where the ``";"`` is used
132
+ # as the row separator instead of newline.
133
+
134
+ fig = plt .figure (constrained_layout = True )
135
+ ax_dict = fig .subplot_mosaic (mosaic )
136
+ identify_axes (ax_dict )
126
137
127
138
###############################################################################
139
+ # Axes spanning multiple rows/columns
140
+ # ===================================
141
+ #
128
142
# Something we can do with `.Figure.subplot_mosaic` that you can not
129
143
# do with `.Figure.subplots` is specify that an Axes should span
130
144
# several rows or columns.
131
- #
132
- # If we want to re-arrange our four Axes to have C be a horizontal
133
- # span on the bottom and D be a vertical span on the right we would do
145
+
146
+
147
+ ###############################################################################
148
+ # If we want to re-arrange our four Axes to have ``"C"`` be a horizontal
149
+ # span on the bottom and ``"D"`` be a vertical span on the right we would do
134
150
135
151
axd = plt .figure (constrained_layout = True ).subplot_mosaic (
136
152
"""
0 commit comments