Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ad2818

Browse files
committed
Comment re: non-working case of tight_layout.
1 parent 6a223c7 commit 6ad2818

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/tight_layout.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
293293

294294
span_pairs = []
295295
for ss in ss_to_subplots:
296+
# The intent here is to support axes from different gridspecs where
297+
# one's nrows (or ncols) is a multiple of the other (e.g. 2 and 4),
298+
# but this doesn't actually work because the computed wspace, in
299+
# relative-axes-height, corresponds to different physical spacings for
300+
# the 2-row grid and the 4-row grid. Still, this code is left, mostly
301+
# for backcompat.
296302
rows, cols = ss.get_gridspec().get_geometry()
297303
div_row, mod_row = divmod(max_nrows, rows)
298304
div_col, mod_col = divmod(max_ncols, cols)

0 commit comments

Comments
 (0)