matplotlib.patches.Wedge#

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

基类:Patch

楔形补丁。

一个以 x, y 为中心,半径为 r 的楔形,从 theta1theta2 (以度为单位)扫过。如果给定了 width,则从内半径 r - width 到外半径 r 绘制一个部分楔形。

有效的关键字参数是:

属性

描述

agg_filter

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

alpha

未知

animated

布尔值

抗锯齿 或 aa

布尔值或无

capstyle

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

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

补丁或(路径,变换)或无

颜色

color

edgecolor 或 ec

color or None

facecolor 或 fc

color or None

figure

FigureSubFigure

fill

布尔值

gid

str

hatch

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

in_layout

布尔值

joinstyle

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

标签

对象

linestyle 或 ls

{'-', '--', '-.', ':', '', (偏移, 开关序列), ...}

线宽 或 lw

浮点数或无

鼠标悬停

布尔值

path_effects

AbstractPathEffect 的列表

picker

None 或 bool 或 float 或 callable

光栅化

布尔值

sketch_params

(scale: float, length: float, randomness: float)

snap

布尔值或无

transform

Transform

url

str

可见

布尔值

zorder

float

get_path()[源代码][源代码]#

返回此补丁的路径。

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>, 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>)[源代码]#

一次性设置多个属性。

支持的属性有

属性

描述

agg_filter

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

alpha

标量或无

animated

布尔值

抗锯齿 或 aa

布尔值或无

capstyle

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

中心

未知

clip_box

BboxBase 或 None

clip_on

布尔值

clip_path

补丁或(路径,变换)或无

颜色

color

edgecolor 或 ec

color or None

facecolor 或 fc

color or None

figure

FigureSubFigure

fill

布尔值

gid

str

hatch

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

in_layout

布尔值

joinstyle

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

标签

对象

linestyle 或 ls

{'-', '--', '-.', ':', '', (偏移, 开关序列), ...}

线宽 或 lw

浮点数或无

鼠标悬停

布尔值

path_effects

AbstractPathEffect 的列表

picker

None 或 bool 或 float 或 callable

半径

未知

光栅化

布尔值

sketch_params

(scale: float, length: float, randomness: float)

snap

布尔值或无

theta1

未知

theta2

未知

transform

Transform

url

str

可见

布尔值

宽度

未知

zorder

float

set_center(center)[源代码][源代码]#
set_radius(radius)[源代码][源代码]#
set_theta1(theta1)[源代码][源代码]#
set_theta2(theta2)[源代码][源代码]#
set_width(width)[源代码][源代码]#

使用 matplotlib.patches.Wedge 的示例#

一个带有标签的派和一个甜甜圈

A pie and a donut with labels

Matplotlib 艺术家的参考

Reference for Matplotlib artists

圆、楔形和多边形

Circles, Wedges and Polygons

SVG 滤镜派

SVG filter pie

石川图

Ishikawa Diagram