matplotlib.patches.Annulus#

class matplotlib.patches.Annulus(xy, r, width, angle=0.0, **kwargs)[源代码][源代码]#

基类:Patch

一个椭圆环。

参数:
xy(浮点数, 浮点数)

环中心点的xy坐标。

r浮点数或 (浮点数, 浮点数)

半径,或半轴:

  • 如果浮动:外圆的半径。

  • 如果两个浮点数:外椭圆的半长轴和半短轴。

宽度浮动

环形环的宽度(厚度)。宽度是从外椭圆向内测量的,因此对于内椭圆,半轴由 r - width 给出。width 必须小于或等于半短轴。

角度float, 默认值: 0

旋转角度(以度为单位,从正x轴逆时针方向)。对于圆形环(即,如果 r 是标量)则忽略。

**kwargs

关键字参数控制 Patch 属性:

属性

描述

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

填充

布尔

gid

str

hatch

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

in_layout

布尔

joinstyle

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

标签

对象

linestyle 或 ls

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

linewidth 或 lw

浮点数或无

鼠标悬停

布尔

path_effects

AbstractPathEffect 列表

picker

None 或 bool 或 float 或 callable

光栅化

布尔

sketch_params

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

snap

布尔值或无

transform

Transform

url

str

可见

布尔

zorder

浮动

property angle#

返回环的角度。

property center#

返回环的中心。

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

返回环的角度。

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

返回环的中心。

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

返回此补丁的路径。

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

返回环形区域的长半轴和短半轴。

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

返回环形环的宽度(厚度)。

property radii#

返回环形区域的长半轴和短半轴。

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>, 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>, radii=<UNSET>, rasterized=<UNSET>, semimajor=<UNSET>, semiminor=<UNSET>, sketch_params=<UNSET>, snap=<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

填充

布尔

gid

str

hatch

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

in_layout

布尔

joinstyle

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

标签

对象

linestyle 或 ls

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

linewidth 或 lw

浮点数或无

鼠标悬停

布尔

path_effects

AbstractPathEffect 列表

picker

None 或 bool 或 float 或 callable

半径

浮点数或 (浮点数, 浮点数)

光栅化

布尔

semimajor

浮动

semiminor

浮动

sketch_params

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

snap

布尔值或无

transform

Transform

url

str

可见

布尔

宽度

浮动

zorder

浮动

set_angle(angle)[源代码][源代码]#

设置环的倾斜角度。

参数:
角度浮动
set_center(xy)[源代码][源代码]#

设置环的中心。

参数:
xy(浮点数, 浮点数)
set_radii(r)[源代码][源代码]#

设置环的半长轴(a)和半短轴(b)。

参数:
r浮点数或 (浮点数, 浮点数)

半径,或半轴:

  • 如果浮动:外圆的半径。

  • 如果两个浮点数:外椭圆的半长轴和半短轴。

set_semimajor(a)[源代码][源代码]#

设置环的半长轴 a

参数:
a浮动
set_semiminor(b)[源代码][源代码]#

设置环的半短轴 b

参数:
b浮动
set_width(width)[源代码][源代码]#

设置环形环的宽度(厚度)。

宽度是从外椭圆向内测量的。

参数:
宽度浮动
property width#

返回环形环的宽度(厚度)。