mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox#
- class mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox(transform, loc, pad=0.4, borderpad=0.5, prop=None, frameon=True, **kwargs)[source]#
-
一个带变换坐标的锚定容器。
添加到 *drawing_area* 的艺术对象将根据所用变换的坐标进行缩放。此艺术对象的尺寸将缩放以包含添加的艺术对象。
- 参数:
- transform
Transform
正在使用的坐标系的变换对象,即
matplotlib.axes.Axes.transData
。- locstr
此艺术对象的位置。有效位置包括“左上”、“中上”、“右上”、“中左”、“中心”、“中右”、“左下”、“中下”、“右下”。为了向后兼容,也接受数值。有关详细信息,请参阅
Legend
的参数 *loc*。- padfloat, 默认值:0.4
子对象周围的填充,以字体大小的百分比表示。
- borderpadfloat, 默认值:0.5
边框填充,以字体大小的比例表示。
- prop
FontProperties
,可选 用作填充参考的字体属性。
- frameonbool,默认值:True
如果为 True,则在此艺术对象周围绘制一个框。
- **kwargs
转发到
AnchoredOffsetbox
的关键字参数。
- transform
- 属性:
- drawing_area
AuxTransformBox
用于显示艺术对象的容器。
- drawing_area
示例
要在数据坐标中在左上角显示一个宽度为0.1,高度为0.4的椭圆
>>> box = AnchoredAuxTransformBox(ax.transData, loc='upper left') >>> el = Ellipse((0, 0), width=0.1, height=0.4, angle=30) >>> box.drawing_area.add_artist(el) >>> ax.add_artist(box)
- 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>)[source]#
一次性设置多个属性。
支持的属性包括:
属性
描述
一个过滤函数,它接受一个 (m, n, 3) 浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组以及图像左下角的两个偏移量
浮点数或 None
布尔值
未知
未知
BboxBase
或 None布尔值
Patch 或 (Path, Transform) 或 None
str
浮点数
布尔值
object
布尔值
(float, float) 或 callable
list of
AbstractPathEffect
None 或 布尔值 或 浮点数 或 可调用对象
布尔值
(scale: 浮点数, length: 浮点数, randomness: 浮点数)
布尔值或 None
str
布尔值
浮点数
浮点数