@@ -134,31 +134,32 @@ def auto_adjust_subplotpars(fig, renderer,
134
134
135
135
if num2 is None :
136
136
# left
137
- hspaces [row1 * (cols + 1 ) + col1 ].append (_get_left ( tight_bbox ,
138
- ax_bbox ))
137
+ hspaces [row1 * (cols + 1 ) + col1 ].append (
138
+ _get_left ( tight_bbox , ax_bbox ))
139
139
# right
140
140
hspaces [row1 * (cols + 1 ) + (col1 + 1 )].append (
141
141
_get_right (tight_bbox , ax_bbox ))
142
142
# top
143
- vspaces [row1 * cols + col1 ].append (_get_top (tight_bbox , ax_bbox ))
143
+ vspaces [row1 * cols + col1 ].append (
144
+ _get_top (tight_bbox , ax_bbox ))
144
145
# bottom
145
- vspaces [(row1 + 1 ) * cols + col1 ].append (_get_bottom ( tight_bbox ,
146
- ax_bbox ))
146
+ vspaces [(row1 + 1 ) * cols + col1 ].append (
147
+ _get_bottom ( tight_bbox , ax_bbox ))
147
148
148
149
else :
149
150
row2 , col2 = divmod (num2 , cols )
150
151
151
152
for row_i in range (row1 , row2 + 1 ):
152
153
# left
153
154
hspaces [row_i * (cols + 1 ) + col1 ].append (
154
- _get_left (tight_bbox , ax_bbox ))
155
+ _get_left (tight_bbox , ax_bbox ))
155
156
# right
156
157
hspaces [row_i * (cols + 1 ) + (col2 + 1 )].append (
157
158
_get_right (tight_bbox , ax_bbox ))
158
159
for col_i in range (col1 , col2 + 1 ):
159
160
# top
160
- vspaces [row1 * cols + col_i ].append (_get_top ( tight_bbox ,
161
- ax_bbox ))
161
+ vspaces [row1 * cols + col_i ].append (
162
+ _get_top ( tight_bbox , ax_bbox ))
162
163
# bottom
163
164
vspaces [(row2 + 1 ) * cols + col_i ].append (
164
165
_get_bottom (tight_bbox , ax_bbox ))
@@ -190,10 +191,8 @@ def auto_adjust_subplotpars(fig, renderer,
190
191
top = 1 - margin_top )
191
192
192
193
if cols > 1 :
193
- hspace = max ([sum (s )
194
- for i in range (rows )
195
- for s
196
- in hspaces [i * (cols + 1 ) + 1 :(i + 1 ) * (cols + 1 ) - 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 ])
197
196
hspace += hpad_inches / fig_width_inch
198
197
h_axes = ((1 - margin_right - margin_left ) -
199
198
hspace * (cols - 1 )) / cols
0 commit comments