matplotlib.pyplot.broken_barh — Matplotlib 3.10.3 documentation (original) (raw)

matplotlib.pyplot.broken_barh(xranges, yrange, *, 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.

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(ymin, yheight)

The y-position and extent for all the rectangles.

Returns:

PolyCollection

Other Parameters:

dataindexable object, optional

If given, all parameters also accept a string s, which is interpreted as data[s] if s is a key in data.

**kwargsPolyCollection properties

Each kwarg can be either a single argument applying to all rectangles, e.g.:

or a sequence of arguments over which is cycled, e.g.:

facecolors=('black', 'blue')

would create interleaving black and blue rectangles.

Supported keywords:

Notes

Examples using matplotlib.pyplot.broken_barh#