matplotlib.axes.Axes.broken_barh#
- Axes.broken_barh(xranges, yrange, align='bottom', *, data=None, **kwargs)[source]#
Plot a horizontal sequence of rectangles.
A rectangle is drawn for each element of xranges. All rectangles have the same vertical position and size defined by yrange.
Note: Rectangles may become invisible if their width is smaller than the resolution of the display. If you expect very narrow rectangles, consider adding an edge with the same color as the facecolor by passing ``edgecolor="face"`. The edge will always be drawn, making narrow rectangles visible.
- Parameters:
- xrangessequence of tuples (xmin, xwidth)
The x-positions and extents of the rectangles. For each tuple (xmin, xwidth) a rectangle is drawn from xmin to xmin + xwidth.
- yrange(ypos, yheight)
The y-position and extent for all the rectangles.
- align{"bottom", "center", "top"}, default: 'bottom'
The alignment of the yrange with respect to the y-position. One of:
"bottom": Resulting y-range [ypos, ypos + yheight]
"center": Resulting y-range [ypos - yheight/2, ypos + yheight/2]
"top": Resulting y-range [ypos - yheight, ypos]
Added in version 3.11.
- Returns:
- Other Parameters:
- dataindexable object, optional
If given, all parameters also accept a string
s, which is interpreted asdata[s]ifsis a key indata.- **kwargs
PolyCollectionproperties Each kwarg can be either a single argument applying to all rectangles, e.g.:
facecolors='black'
or a sequence of arguments over which is cycled, e.g.:
facecolors=('black', 'blue')
would create interleaving black and blue rectangles.
Supported keywords:
Property
Description
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
array-like or float or None
bool
antialiasedoraaorantialiasedsbool or list of bools
array-like or None
CapStyleor {'butt', 'projecting', 'round'}(vmin: float, vmax: float)
BboxBaseor Nonebool
Patch or (Path, Transform) or None
Colormapor str or Nonecolor or list of RGBA tuples
edgecolororecoredgecolorsfacecolororfacecolorsorfcstr
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
unknown
bool
JoinStyleor {'miter', 'round', 'bevel'}object
linestyleordashesorlinestylesorlslinewidthorlinewidthsorlwfloat or list of floats
bool
Normalizeor str or None(N, 2) or (2,) array-like
list of
AbstractPathEffectlist of array-like
None or bool or float or callable
float
bool
numpy.ndarrayor None(scale: float, length: float, randomness: float)
bool or None
str
list of str or None
list of array-like
unknown
bool
float