Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 600544c

Browse filesBrowse files
committed
DOC: ensure local variables are defined
1 parent fc5dcf4 commit 600544c
Copy full SHA for 600544c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed

‎doc/users/tight_layout_guide.rst

Copy file name to clipboardExpand all lines: doc/users/tight_layout_guide.rst
+6-8Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.