Skip to content

Commit 37bae0b

Browse files
committed
Remove outdated statement in tight_layout guide.
use_gridspec has been the default since c3ce78d (2012). Admittedly explaining the difference between Subplot and Axes (the former can be tightlayouted, not the latter) would be nice, but that's another project.
1 parent 60b3f54 commit 37bae0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tutorials/intermediate/tight_layout_guide.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,15 @@ def example_plot(ax, fontsize=12):
336336
# ========
337337
#
338338
# If you create a colorbar with `.Figure.colorbar`, the created colorbar is
339-
# an instance of Axes, *not* Subplot, so tight_layout does not work. With
340-
# Matplotlib v1.1, you may create a colorbar as a subplot using the gridspec.
339+
# drawn in a Subplot as long as the parent axes is also a Subplot, so
340+
# `.Figure.tight_layout` will work.
341341

342342
plt.close('all')
343343
arr = np.arange(100).reshape((10, 10))
344344
fig = plt.figure(figsize=(4, 4))
345345
im = plt.imshow(arr, interpolation="none")
346346

347-
plt.colorbar(im, use_gridspec=True)
347+
plt.colorbar(im)
348348

349349
plt.tight_layout()
350350

0 commit comments

Comments
 (0)