matplotlib.patches.Circle#

class matplotlib.patches.Circle(xy, radius=5, **kwargs)[源代码][源代码]#

基类:Ellipse

一个圆形补丁。

在中心 xy = (x, y) 处创建一个给定 半径 的真正圆形。

CirclePolygon 这种多边形近似不同,这使用了贝塞尔样条,更接近于一个无比例的圆。

有效的关键字参数是:

属性

描述

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'}

标签

对象

线型 或 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

浮动

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

返回圆的半径。

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>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<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>)[源代码]#

一次性设置多个属性。

支持的属性有

属性

描述

agg_filter

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

alpha

标量或无

角度

浮动

animated

布尔

抗锯齿 或 aa

布尔值或无

capstyle

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

center

(浮点数, 浮点数)

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'}

标签

对象

线型 或 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

浮动

set_radius(radius)[源代码][源代码]#

设置圆的半径。

参数:
半径浮动

使用 matplotlib.patches.Circle 的示例#

使用补丁裁剪图像

Clipping images with patches

坐标轴方框比例

Axes box aspect

AnnotationBbox 演示

AnnotationBbox demo

Matplotlib 艺术家的参考

Reference for Matplotlib artists

海豚

Dolphins

Mmh 甜甜圈!!!

Mmh Donuts!!!

圆、楔形和多边形

Circles, Wedges and Polygons

ggplot 样式表

ggplot style sheet

灰度样式表

Grayscale style sheet

样式表引用

Style sheets reference

简单的锚定艺术家

Simple Anchored Artists

图的结构

Anatomy of a figure

镜子

Looking glass

锚定艺术家

Anchored Artists

自定义投影

Custom projection

打包气泡图

Packed-bubble chart

在3D图中绘制平面物体

Draw flat objects in 3D plot

雷达图(又称蜘蛛图或星形图)

Radar chart (aka spider or star chart)

变换教程

Transformations Tutorial

图例指南

Legend guide

注解

Annotations