matplotlib.patches.RegularPolygon#
- class matplotlib.patches.RegularPolygon(xy, numVertices, *, radius=5, orientation=0, **kwargs)[源码]#
基类:
Patch正多边形补丁(Patch)。
- 参数:
- xy(float, float)
中心位置。
- numVerticesint
顶点数量。
- radius浮点数
从中心到每个顶点的距离。
- orientationfloat
多边形旋转角度(以弧度为单位)。
- **kwargs
Patch属性属性
描述
一个过滤函数,它接受一个 (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
布尔值
浮点数
- get_patch_transform()[源码]#
返回将补丁坐标映射到数据坐标的
Transform实例。例如,可以通过提供单位圆的坐标,并使用一个将坐标(补丁坐标)缩放5倍的变换,来定义一个表示半径为5的圆形补丁。
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<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>, 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>, zorder=<UNSET>)[源码]#
一次性设置多个属性。
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
布尔值
浮点数