matplotlib.figure.Figure.set_layout_engine#
- Figure.set_layout_engine(layout=None, **kwargs)[源代码][源代码]#
设置此图形的布局引擎。
- 参数:
- 布局 : {'constrained', 'compressed', 'tight', 'none',
LayoutEngine
, None}{'constrained', 'compressed', 'tight', 'none',} 'constrained' 将使用
ConstrainedLayoutEngine
'compressed' 也会使用
ConstrainedLayoutEngine
,但带有一个修正,尝试为固定纵横比的 Axes 制作一个好的布局。'tight' 使用
TightLayoutEngine
'none' 移除布局引擎。
如果是一个
LayoutEngine
实例,将使用该实例。如果
None
,行为由rcParams["figure.autolayout"]
(default:False
) 控制(如果为True
,则行为如同传递了 'tight')和rcParams["figure.constrained_layout.use`(如果为 `True"]
,则行为如同传递了 'constrained')。如果两者都为True
,则rcParams["figure.autolayout"]
(default:False
) 优先。用户和库可以定义自己的布局引擎,并直接传递实例。
- **kwargs
关键字参数被传递给布局引擎,用于设置内边距和外边距大小。仅在 layout 是字符串时使用。
- 布局 : {'constrained', 'compressed', 'tight', 'none',