matplotlib.patches.Ellipse#
- class matplotlib.patches.Ellipse(xy, width, height, *, angle=0, **kwargs)[source]#
基类:
Patch一个无缩放的椭圆。
- 参数:
- xy(float, float)
xy 椭圆中心的坐标。
- width浮点数
水平轴的总长度(直径)。
- heightfloat
垂直轴的总长度(直径)。
- anglefloat, 默认值: 0
逆时针旋转的角度(以度为单位)。
备注
有效的关键字参数有:
属性
描述
一个过滤函数,它接受一个 (m, n, 3) 浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组以及图像左下角的两个偏移量
未知
布尔值
布尔值或 None
CapStyle或 {'butt', 'projecting', 'round'}BboxBase或 None布尔值
Patch 或 (Path, Transform) 或 None
颜色 或 None
颜色 或 None
颜色 或 None
布尔值
str
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
未知
color 或 'edge' 或 None
布尔值
JoinStyle或 {'miter', 'round', 'bevel'}object
{'-', '--', '-.', ':', '', ...} 或 (offset, on-off-seq)
浮点数或 None
布尔值
None 或 布尔值 或 浮点数 或 可调用对象
布尔值
(scale: 浮点数, length: 浮点数, randomness: 浮点数)
布尔值或 None
str
布尔值
浮点数
- property angle#
返回椭圆的角度。
- property center#
返回椭圆的中心。
- get_patch_transform()[source]#
返回将补丁坐标映射到数据坐标的
Transform实例。例如,可以通过提供单位圆的坐标,并使用一个将坐标(补丁坐标)缩放5倍的变换,来定义一个表示半径为5的圆形补丁。
- property height#
返回椭圆的高度。
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, edgegapcolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<UNSET>, hatchcolor=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[source]#
一次性设置多个属性。
a.set(a=A, b=B, c=C)
等同于
a.set_a(A) a.set_b(B) a.set_c(C)
除全名属性外,还支持别名,例如
set(lw=2)等同于set(linewidth=2),但同时传入两者会报错。各个 setter 的调用顺序与
set()中的参数顺序一致。然而,大多数属性并不相互依赖,因此顺序通常无关紧要。支持的属性包括:
属性
描述
一个过滤函数,它接受一个 (m, n, 3) 浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组以及图像左下角的两个偏移量
浮点数或 None
浮点数
布尔值
布尔值或 None
CapStyle或 {'butt', 'projecting', 'round'}(浮点数, 浮点数)
BboxBase或 None布尔值
Patch 或 (Path, Transform) 或 None
颜色 或 None
颜色 或 None
颜色 或 None
布尔值
str
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
未知
color 或 'edge' 或 None
浮点数
布尔值
JoinStyle或 {'miter', 'round', 'bevel'}object
{'-', '--', '-.', ':', '', ...} 或 (offset, on-off-seq)
浮点数或 None
布尔值
None 或 布尔值 或 浮点数 或 可调用对象
布尔值
(scale: 浮点数, length: 浮点数, randomness: 浮点数)
布尔值或 None
str
布尔值
浮点数
浮点数
- property width#
返回椭圆的宽度。