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

Skip to content

Commit 118aa9f

Browse files
committed
DOC:
1 parent 731a959 commit 118aa9f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/matplotlib/layout_engine.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ def __init__(self, *, h_pad=None, w_pad=None,
196196
If h/wspace < h/w_pad, then the pads are used instead.
197197
Default to :rc:`figure.constrained_layout.hspace` and
198198
:rc:`figure.constrained_layout.wspace`.
199+
compress : bool
200+
Whether to use compressed layout or not; useful for fixed-aspect
201+
simple grids of axes (e.g. a grid of images). See
202+
`_compressed_layout`.
199203
"""
200204
super().__init__(**kwargs)
201205
# set the defaults:
@@ -205,7 +209,6 @@ def __init__(self, *, h_pad=None, w_pad=None,
205209
hspace=mpl.rcParams['figure.constrained_layout.hspace'])
206210
# set anything that was passed in (None will be ignored):
207211
self.set(w_pad=w_pad, h_pad=h_pad, wspace=wspace, hspace=hspace)
208-
# see CompressedLayoutEngine below...
209212
self._compress = compress
210213

211214
def execute(self, fig):

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,12 @@ def example_plot(ax, fontsize=12, hide_labels=False):
451451
axs[1].set_position([0.2, 0.2, 0.4, 0.4])
452452

453453
###############################################################################
454+
# .. _compressed_layout:
455+
#
454456
# Grids of fixed aspect-ratio Axes: "compressed" layout
455457
# =====================================================
456458
#
459+
#
457460
# By default, ``constrained_layout`` acts on the total size of an axes, but
458461
# when Axes have fixed aspect ratios, one side is made shorter. For a grid
459462
# of such Axes, this leaves a large gap in the shortened direction. For

0 commit comments

Comments
 (0)