matplotlib.patches.Wedge#

class matplotlib.patches.Wedge(center, r, theta1, theta2, *, width=None, **kwargs)[source]#

基类:Patch

楔形补丁。

xy中心为圆心,半径为r,扫过theta1theta2(以度为单位)的扇形。如果提供了width,则从内半径r - width到外半径r绘制一个部分扇形。

有效的关键字参数有:

属性

描述

agg_filter

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

alpha

未知

animated

布尔值

antialiasedaa

布尔值或 None

capstyle

CapStyle 或 {'butt', 'projecting', 'round'}

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

Patch 或 (Path, Transform) 或 None

color

color

edgecolorec

颜色 或 None

facecolorfc

颜色 或 None

figure

FigureSubFigure

fill

布尔值

gid

str

hatch

{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

hatch_linewidth

未知

in_layout

布尔值

joinstyle

JoinStyle 或 {'miter', 'round', 'bevel'}

label

object

linestylels

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidthlw

浮点数或 None

mouseover

布尔值

path_effects

列表形式的 AbstractPathEffect

picker

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

rasterized

布尔值

sketch_params

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

snap

布尔值或 None

transform

变换

url

str

visible

布尔值

zorder

浮点数

get_path()[source]#

返回此补丁的路径。

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<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>, theta1=<UNSET>, theta2=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[source]#

一次性设置多个属性。

支持的属性包括:

属性

描述

agg_filter

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

alpha

浮点数或 None

animated

布尔值

antialiasedaa

布尔值或 None

capstyle

CapStyle 或 {'butt', 'projecting', 'round'}

居中

未知

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

Patch 或 (Path, Transform) 或 None

color

color

edgecolorec

颜色 或 None

facecolorfc

颜色 或 None

figure

FigureSubFigure

fill

布尔值

gid

str

hatch

{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

hatch_linewidth

未知

in_layout

布尔值

joinstyle

JoinStyle 或 {'miter', 'round', 'bevel'}

label

object

linestylels

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidthlw

浮点数或 None

mouseover

布尔值

path_effects

列表形式的 AbstractPathEffect

picker

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

radius

未知

rasterized

布尔值

sketch_params

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

snap

布尔值或 None

theta1

未知

theta2

未知

transform

变换

url

str

visible

布尔值

width

未知

zorder

浮点数

set_center(center)[source]#
set_radius(radius)[source]#
set_theta1(theta1)[source]#
set_theta2(theta2)[source]#
set_width(width)[source]#

使用 matplotlib.patches.Wedge 的示例#

SVG 滤镜饼图

SVG 滤镜饼图

带标签的饼图和甜甜圈图

带标签的饼图和甜甜圈图

Matplotlib 艺术家参考

Matplotlib 艺术家参考

圆、扇形和多边形

圆、扇形和多边形

石川图

石川图