Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ec83125 + 37bae0b commit 203ad87Copy full SHA for 203ad87
1 file changed
tutorials/intermediate/tight_layout_guide.py
@@ -336,15 +336,15 @@ def example_plot(ax, fontsize=12):
336
# ========
337
#
338
# 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.
+# drawn in a Subplot as long as the parent axes is also a Subplot, so
+# `.Figure.tight_layout` will work.
341
342
plt.close('all')
343
arr = np.arange(100).reshape((10, 10))
344
fig = plt.figure(figsize=(4, 4))
345
im = plt.imshow(arr, interpolation="none")
346
347
-plt.colorbar(im, use_gridspec=True)
+plt.colorbar(im)
348
349
plt.tight_layout()
350
0 commit comments