mpl_toolkits.axes_grid1.inset_locator.AnchoredSizeLocator#

class mpl_toolkits.axes_grid1.inset_locator.AnchoredSizeLocator(bbox_to_anchor, x_size, y_size, loc, borderpad=0.5, bbox_transform=None)[源代码]#

基类: AnchoredLocatorBase

参数:
locstr

框的位置。有效位置包括:'左上'、'中上'、'右上'、'左中'、'居中'、'右中'、'左下'、'中下'、'右下'。为了向后兼容,也接受数值。详见 Legend 的参数 *loc*。

padfloat, 默认值:0.4

子项周围的填充,作为字号的一部分。

borderpadfloat, 默认值:0.5

偏移框边框与 *bbox_to_anchor* 之间的填充。

childOffsetBox

将被锚定的框。

propFontProperties

这仅用作填充的参考。如果未提供,rcParams["legend.fontsize"] (默认值:'medium')将被使用。

frameonbool

是否在框周围绘制边框。

bbox_to_anchorBboxBase、2元组或4元组浮点数

与 *loc* 结合使用,用于定位图例的框。

bbox_transformNone 或 matplotlib.transforms.Transform

边界框 (*bbox_to_anchor*) 的变换。

**kwargs

所有其他参数都传递给 OffsetBox

备注

详见 Legend 中关于锚定机制的详细说明。

get_bbox(renderer)[源代码]#

返回偏移框的边界框,忽略父偏移。

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, bbox_to_anchor=<UNSET>, child=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, mouseover=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[源代码]#

一次性设置多个属性。

支持的属性包括:

属性

描述

agg_filter

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

alpha

浮点数或 None

animated

布尔值

bbox_to_anchor

未知

child

未知

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

Patch 或 (Path, Transform) 或 None

figure

Figure

gid

str

height

浮点数

in_layout

布尔值

label

object

mouseover

布尔值

offset

(float, float) 或 callable

path_effects

的列表 AbstractPathEffect

picker

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

rasterized

布尔值

sketch_params

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

snap

布尔值或 None

transform

变换

url

str

visible

布尔值

width

浮点数

zorder

浮点数