Skip to content

Commit 6bb3c55

Browse files
committed
Merge pull request matplotlib#1365 from NelleV/fix_bb
Fix list comprehension indexing
2 parents 8ec30b7 + 32ba3c4 commit 6bb3c55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/tight_layout.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ def auto_adjust_subplotpars(fig, renderer,
191191
top=1 - margin_top)
192192

193193
if cols > 1:
194-
hspace_strip = hspaces[i * (cols + 1) + 1:(i + 1) * (cols + 1) - 1]
195-
hspace = max([sum(s) for i in range(rows) for s in hspace_strip])
194+
hspace = max([sum(s)
195+
for i in range(rows)
196+
for s
197+
in hspaces[i * (cols + 1) + 1:(i + 1) * (cols + 1) - 1]])
196198
hspace += hpad_inches / fig_width_inch
197199
h_axes = ((1 - margin_right - margin_left) -
198200
hspace * (cols - 1)) / cols

0 commit comments

Comments
 (0)