@@ -211,13 +211,13 @@ For example, this can be used for a figure with multiple gridspecs.
211
211
:context:
212
212
213
213
gs2 = gridspec.GridSpec(3, 1)
214
-
214
+
215
215
for ss in gs2:
216
216
ax = fig.add_subplot(ss)
217
217
example_plot(ax)
218
218
ax.set_title("")
219
219
ax.set_xlabel("")
220
-
220
+
221
221
ax.set_xlabel("x-label", fontsize=12)
222
222
223
223
gs2.tight_layout(fig, rect=[0.5, 0, 1, 1], h_pad=0.5)
@@ -230,7 +230,7 @@ We may try to match the top and bottom of two grids ::
230
230
231
231
gs1.update(top=top, bottom=bottom)
232
232
gs2.update(top=top, bottom=bottom)
233
-
233
+
234
234
235
235
While this should be mostly good enough, adjusting top and bottom
236
236
may require adjustment of hspace also. To update hspace & vspace, we
@@ -269,7 +269,7 @@ While limited, the axes_grid1 toolkit is also supported.
269
269
fig = plt.figure()
270
270
271
271
from mpl_toolkits.axes_grid1 import Grid
272
- grid = Grid(fig, rect=111, nrows_ncols=(2,2),
272
+ grid = Grid(fig, rect=111, nrows_ncols=(2,2),
273
273
axes_pad=0.25, label_mode='L',
274
274
)
275
275
@@ -294,6 +294,7 @@ colorbar as a subplot using the gridspec.
294
294
:context:
295
295
296
296
plt.close('all')
297
+ arr = np.arange(100).reshape((10,10))
297
298
fig = plt.figure(figsize=(4, 4))
298
299
im = plt.imshow(arr, interpolation="none")
299
300
@@ -309,6 +310,7 @@ explicitly create an axes for colorbar.
309
310
:context:
310
311
311
312
plt.close('all')
313
+ arr = np.arange(100).reshape((10,10))
312
314
fig = plt.figure(figsize=(4, 4))
313
315
im = plt.imshow(arr, interpolation="none")
314
316
@@ -318,7 +320,3 @@ explicitly create an axes for colorbar.
318
320
plt.colorbar(im, cax=cax)
319
321
320
322
plt.tight_layout()
321
-
322
-
323
-
324
-
0 commit comments