matplotlib.figure.Figure.set_layout_engine#
- Figure.set_layout_engine(layout=None, **kwargs)[source]#
为此图形设置布局引擎。
- 参数:
- layout{'constrained', 'compressed', 'tight', 'none',
LayoutEngine
, None} 'constrained' 将使用
ConstrainedLayoutEngine
'compressed' 也将使用
ConstrainedLayoutEngine
,但会进行修正,以尝试为固定宽高比的 Axes 创建良好布局。'tight' 使用
TightLayoutEngine
'none' 移除布局引擎。
如果是
LayoutEngine
实例,则将使用该实例。如果为
None
,则行为由rcParams["figure.autolayout"]
(默认值:False
)(如果为True
,则行为如同传递了 'tight')和rcParams["figure.constrained_layout.use"]
(默认值:False
)(如果为True
,则行为如同传递了 'constrained')控制。如果两者都为True
,则rcParams["figure.autolayout"]
(默认值:False
)优先。用户和库也可以定义自己的布局引擎并直接传递实例。
- **kwargs
关键字参数将传递给布局引擎,用于设置填充和边距大小等。仅当 layout 是字符串时使用。
- layout{'constrained', 'compressed', 'tight', 'none',