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

Skip to content

Commit 3989c06

Browse files
committed
Ignore invisible axes in computing tight_layout.
1 parent 8a77cfb commit 3989c06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/tight_layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def auto_adjust_subplotpars(fig, renderer,
123123
for subplots, ax_bbox, (num1, num2) in zip(subplot_list,
124124
ax_bbox_list,
125125
num1num2_list):
126-
tight_bbox_raw = union([ax.get_tightbbox(renderer) for ax in subplots])
126+
tight_bbox_raw = union([ax.get_tightbbox(renderer) for ax in subplots if ax.get_visible()])
127127
tight_bbox = TransformedBbox(tight_bbox_raw,
128128
fig.transFigure.inverted())
129129

0 commit comments

Comments
 (0)