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)[源代码]#

在坐标轴 (Axes) 上添加一个插图指示器。这是一个位于 bounds 指定位置的矩形,可选择性地添加连接该矩形与插图坐标轴 (Axes.inset_axes) 的连线。

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

待标记矩形的左下角坐标及其宽度和高度。如果未设置,边界将根据 inset_ax 的数据限值计算得出(此时必须提供 inset_ax)。

inset_axAxes, 可选

一个可选的插图坐标轴,用于绘制连接线。将绘制两条连接指示框与插图坐标轴的线,连接点选择在不会与指示框重叠的角落。

transformTransform

矩形坐标的变换方式。默认为 ax.transData,即 rect 的单位采用坐标轴的数据坐标。

facecolor颜色, 默认: 'none'

矩形的填充颜色。

edgecolor颜色, 默认: '0.5'

矩形的边框颜色以及连接线的颜色。

alphafloat 或 None, 默认: 0.5

矩形和连接线的透明度。如果不为 None,此值将覆盖 facecoloredgecolor 参数中包含的任何 alpha 值。

zorderfloat, 默认: 4.99

矩形和连接线的绘制顺序。默认值 4.99 刚好低于插图坐标轴的默认层级。

**kwargs

其他关键字参数将传递给 Rectangle(矩形)补丁。

属性

描述

agg_filter

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

alpha

浮点数或 None

angle

未知

animated

布尔值

antialiasedaa

布尔值或 None

bounds

(左,下,宽,高)

capstyle

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

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

Patch 或 (Path, Transform) 或 None

color

color

edgecolorec

颜色 或 None

edgegapcolor

颜色 或 None

facecolorfc

颜色 或 None

figure

FigureSubFigure

fill

布尔值

gid

str

hatch

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

hatch_linewidth

未知

hatchcolor

color 或 'edge' 或 None

height

未知

in_layout

布尔值

joinstyle

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

label

object

linestylels

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

linewidthlw

浮点数或 None

mouseover

布尔值

path_effects

AbstractPathEffect 列表

picker

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

rasterized

布尔值

sketch_params

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

snap

布尔值或 None

transform

变换

url

str

visible

布尔值

width

未知

x

未知

xy

(浮点数, 浮点数)

y

未知

zorder

浮点数

返回:
inset_indicatorinset.InsetIndicator

一个包含以下内容的绘图对象 (Artist):

inset_indicator.rectangleRectangle

指示器边框。

inset_indicator.connectors包含 4 个 patches.ConnectionPatch 的元组

连接至 inset_ax 四个角(左下、左上、右下、右上)的四条连接线。默认其中两条线的可见性设置为 False,但如果用户认为自动选择的结果不合适,可以将可见性设为 True。

在 3.10 版本更改: 此前返回的是矩形和连接线的元组。

警告

该方法自 3.0 版本起为实验性功能,API 未来可能会发生变化。