matplotlib.axes.Axes.set_position

Axes.set_position(pos, which='both')

设置轴位置。

轴有两个位置属性。“原始”位置是为轴分配的位置。“激活”位置是轴实际绘制的位置。这些位置通常是相同的,除非一个固定的方面设置为轴。见 set_aspect 有关详细信息。

参数:
pos : [左、下、宽、高] 或 Bbox[左、下、宽、高] 或

在新的位置 Figure 协调。

which{'both','active','original'},默认值:'both'

确定要更改的位置变量。

使用实例 matplotlib.axes.Axes.set_position