matplotlib.axes.Axes.set_position#

Axes.set_position(pos, which='both')[源代码]#

设置轴的位置。

Axes 有两个位置属性。'original' 位置是为 Axes 分配的位置。'active' 位置是 Axes 实际绘制的位置。除非为 Axes 设置了固定纵横比,否则这些位置通常是相同的。详情请参阅 Axes.set_aspect

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

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

哪个{'both', 'active', 'original'}, 默认: 'both'

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

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

等高线演示

Contour Demo