matplotlib.axes.Axes.set_position#

Axes.set_position(pos, which='both')[source]#

设置 Axes 的位置。

Axes 有两个位置属性。'original' 位置是为 Axes 分配的位置。'active' 位置是 Axes 实际绘制时的位置。这些位置通常相同,除非为 Axes 设置了固定宽高比。有关详细信息,请参阅 Axes.set_aspect

参数:
pos[left, bottom, width, height] 或 Bbox

Axes 在 Figure 坐标系中的新位置。

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

确定要更改哪些位置变量。

使用 matplotlib.axes.Axes.set_position 的示例#

等高线演示

等高线演示