8000 DOC: ensure local variables are defined · matplotlib/matplotlib@c78c4db · GitHub
[go: up one dir, main page]

Skip to content

Commit c78c4db

Browse files
committed
DOC: ensure local variables are defined
1 parent fc4f3f3 commit c78c4db

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

doc/users/tight_layout_guide.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ For example, this can be used for a figure with multiple gridspecs.
211211
:context:
212212

213213
gs2 = gridspec.GridSpec(3, 1)
214-
214+
215215
for ss in gs2:
216216
ax = fig.add_subplot(ss)
217217
example_plot(ax)
218218
ax.set_title("")
219219
ax.set_xlabel("")
220-
220+
221221
ax.set_xlabel("x-label", fontsize=12)
222222

223223
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 ::
230230

231231
gs1.update(top=top, bottom=bottom)
232232
gs2.update(top=top, bottom=bottom)
233-
233+
234234

235235
While this should be mostly good enough, adjusting top and bottom
236236
may require adjustment of hspace also. To update hspace & vspace, we
@@ -269,7 +269,7 @@ While limited, the axes_grid1 toolkit is also supported.
269269
fig = plt.figure()
270270

271271
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),
273273
axes_pad=0.25, label_mode='L',
274274
)
275275

@@ -294,6 +294,7 @@ colorbar as a subplot using the gridspec.
294294
:context:
295295

296296
plt.close('all')
297+
arr = np.arange(100).reshape((10,10))
297298
fig = plt.figure(figsize=(4, 4))
298299
im = plt.imshow(arr, interpolation="none")
299300

@@ -309,6 +310,7 @@ explicitly create an axes for colorbar.
309310
:context:
310311

311312
plt.close('all')
313+
arr = np.arange(100).reshape((10,10))
312314
fig = plt.figure(figsize=(4, 4))
313315
im = plt.imshow(arr, interpolation="none")
314316

@@ -318,7 +320,3 @@ explicitly create an axes for colorbar.
318320
plt.colorbar(im, cax=cax)
319321

320322
plt.tight_layout()
321-
322-
323-
324-

0 commit comments

Comments
 (0)
0