matplotlib.pyplot.broken_barh#

matplotlib.pyplot.broken_barh(xranges, yrange, *, data=None, **kwargs)[源代码][源代码]#

绘制一排水平排列的矩形。

xranges 的每个元素绘制一个矩形。所有矩形具有相同的垂直位置和由 yrange 定义的大小。

参数:
xranges : 元组序列 (xmin, xwidth)元组序列 (

矩形的x位置和范围。对于每个元组 (xmin, xwidth),从 xminxmin + xwidth 绘制一个矩形。

yrange()

所有矩形的y轴位置和范围。

返回:
PolyCollection
其他参数:
数据可索引对象,可选

如果提供,所有参数也接受一个字符串 s,如果 sdata 中的一个键,则它被解释为 data[s]

**kwargs : PolyCollection 属性PolyCollection 属性

每个 kwarg 可以是应用于所有矩形的单个参数,例如:

facecolors='black'

或者是一个在其上循环的参数序列,例如:

facecolors=('black', 'blue')

将创建交错的黑色和蓝色矩形。

支持的关键词:

属性

描述

agg_filter

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

alpha

类似数组或标量或无

animated

布尔

抗锯齿 或 aa 或 antialiaseds

布尔值或布尔值列表

数组

类似数组或 None

capstyle

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

clim

(vmin: 浮点数, vmax: 浮点数)

clip_box

BboxBase 或 None

clip_on

布尔

clip_path

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

cmap

Colormap 或 str 或 None

颜色

color 或 RGBA 元组列表

edgecolor 或 ec 或 edgecolors

colorcolor 列表 或 'face'

facecolor 或 facecolors 或 fc

colorcolor 列表

figure

FigureSubFigure

gid

str

hatch

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

in_layout

布尔

joinstyle

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

标签

对象

linestyle 或虚线或线型或 ls

str 或 tuple 或其列表

linewidth 或 linewidths 或 lw

浮点数或浮点数列表

鼠标悬停

布尔

norm

Normalize 或 str 或 None

offset_transform 或 transOffset

Transform

偏移量

(N, 2) 或 (2,) 数组类

path_effects

AbstractPathEffect 列表

路径

类似数组的列表

picker

None 或 bool 或 float 或 callable

pickradius

浮动

光栅化

布尔

sizes

numpy.ndarray 或 None

sketch_params

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

snap

布尔值或无

transform

Transform

url

str

urls

list of str 或 None

verts

类似数组的列表

verts_and_codes

未知

可见

布尔

zorder

浮动

注释