matplotlib.patches.Circle#
- class matplotlib.patches.Circle(xy, radius=5, **kwargs)[source]#
基类:
Ellipse圆形补丁。
在中心点 xy = (x, y) 处创建一个给定 radius(半径)的真圆。
与作为多边形近似的
CirclePolygon不同,此方法使用贝塞尔样条曲线,更接近于无标度圆。有效的关键字参数有:
属性
描述
一个过滤函数,它接受一个 (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 radius#
返回圆的半径。
- 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>, radius=<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
布尔值
浮点数
浮点数