matplotlib.axes.Axes.indicate_inset#

Axes.indicate_inset(bounds=None, inset_ax=None, *, transform=None, facecolor='none', edgecolor='0.5', alpha=0.5, zorder=None, **kwargs)[source]#

为坐标轴添加一个内嵌指示器。这是在图表上由 *bounds* 指定位置的一个矩形,它可以选择性地包含将该矩形连接到内嵌坐标轴的线 (Axes.inset_axes)。

参数:
bounds[x0, y0, width, height],可选

要标记的矩形的左下角及其宽度和高度。如果未设置,边界将从 *inset_ax* 的数据限制中计算,*inset_ax* 必须提供。

inset_axAxes,可选

一个可选的内嵌坐标轴,用于绘制连接线。将绘制两条连接线,连接指示框到内嵌坐标轴的选定角点,以避免与指示框重叠。

transformTransform

矩形坐标的变换。默认为 ax.transAxes,即 *rect* 的单位是相对于坐标轴的坐标。

facecolor颜色,默认值:'none'

矩形的填充颜色。

edgecolor颜色,默认值:'0.5'

矩形和连接线的颜色。

alpha浮点数或 None,默认值:0.5

矩形和连接线的透明度。如果不是 None,它将覆盖 *facecolor* 和 *edgecolor* 参数中包含的任何 alpha 值。

zorder浮点数,默认值:4.99

矩形和连接线的绘制顺序。默认值 4.99 略低于内嵌坐标轴的默认层级。

**kwargs

其他关键字参数将传递给 Rectangle 补丁

属性

描述

agg_filter

一个过滤函数,它接受一个 (m, n, 3) 浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组以及图像左下角的两个偏移量

alpha

浮点数或 None

angle

未知

animated

布尔值

antialiased or aa

布尔值或 None

bounds

(左,下,宽,高)

capstyle

CapStyle 或 {'butt', 'projecting', 'round'}

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

Patch 或 (Path, Transform) 或 None

color

color

edgecolor or ec

颜色 或 None

facecolor or fc

颜色 或 None

figure

Figure or SubFigure

fill

布尔值

gid

字符串

hatch

{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

hatch_linewidth

未知

height

未知

in_layout

布尔值

joinstyle

JoinStyle 或 {'miter', 'round', 'bevel'}

label

对象

linestyle or ls

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidth or lw

浮点数或 None

mouseover

布尔值

path_effects

AbstractPathEffect 列表

picker

None 或 布尔值 或 浮点数 或 可调用对象

rasterized

布尔值

sketch_params

(scale: 浮点数, length: 浮点数, randomness: 浮点数)

snap

布尔值或 None

transform

变换

url

字符串

visible

布尔值

width

未知

x

未知

xy

(浮点数, 浮点数)

y

未知

zorder

浮点数

返回:
inset_indicatorinset.InsetIndicator

一个包含以下内容的 artist

inset_indicator.rectangleRectangle

指示器框。

inset_indicator.connectorspatches.ConnectionPatch 的4元组

连接到 *inset_ax* 的(左下、左上、右下、右上)角的四条连接线。其中两条线的可见性设置为 *False*,但如果自动选择不正确,用户可以将其可见性设置为 True。

3.10 版更改:之前返回的是矩形和连接器元组。

警告

此方法自 3.0 版本起为实验性,且 API 可能会更改。