Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2633b6b

Browse files
authored
Merge pull request #10159 from timhoffm/axes-doc-broken_barh
improve Axes.broken_barh docstring
2 parents 85becf5 + f80ff7b commit 2633b6b

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,33 +2340,53 @@ def barh(self, *args, **kwargs):
23402340
@docstring.dedent_interpd
23412341
def broken_barh(self, xranges, yrange, **kwargs):
23422342
"""
2343-
Plot horizontal bars.
2343+
Plot a horizontal sequence of rectangles.
23442344
2345-
A collection of horizontal bars spanning *yrange* with a sequence of
2346-
*xranges*.
2345+
A rectangle is drawn for each element of *xranges*. All rectangles
2346+
have the same vertical position and size defined by *yrange*.
23472347
2348-
Required arguments:
2348+
This is a convenience function for instantiating a
2349+
`.BrokenBarHCollection`, adding it to the axes and autoscaling the
2350+
view.
23492351
2350-
========= ==============================
2351-
Argument Description
2352-
========= ==============================
2353-
*xranges* sequence of (*xmin*, *xwidth*)
2354-
*yrange* sequence of (*ymin*, *ywidth*)
2355-
========= ==============================
2352+
Parameters
2353+
----------
2354+
xranges : sequence of tuples (*xmin*, *xwidth*)
2355+
The x-positions and extends of the rectangles. For each tuple
2356+
(*xmin*, *xwidth*) a rectangle is drawn from *xmin* to *xmin* +
2357+
*xwidth*.
2358+
yranges : (*ymin*, *ymax*)
2359+
The y-position and extend for all the rectangles.
23562360
2357-
kwargs are
2358-
:class:`matplotlib.collections.BrokenBarHCollection`
2359-
properties:
2361+
Other Parameters
2362+
----------------
2363+
**kwargs : :class:`~.BrokenBarHCollection` properties
2364+
2365+
Each *kwarg* can be either a single argument applying to all
2366+
rectangles, e.g.::
2367+
2368+
facecolors='black'
23602369
2361-
%(BrokenBarHCollection)s
2370+
or a sequence of arguments over which is cycled, e.g.::
23622371
2363-
these can either be a single argument, i.e.,::
2372+
facecolors=('black', 'blue')
23642373
2365-
facecolors = 'black'
2374+
would create interleaving black and blue rectangles.
23662375
2367-
or a sequence of arguments for the various bars, i.e.,::
2376+
Supported keywords:
2377+
2378+
%(BrokenBarHCollection)s
2379+
2380+
Returns
2381+
-------
2382+
:class:`matplotlib.collections.BrokenBarHCollection`
2383+
2384+
Notes
2385+
-----
2386+
..
2387+
[Empty notes is a workaround to prevent the data note from being
2388+
injected into the Returns section.]
23682389
2369-
facecolors = ('black', 'red', 'green')
23702390
"""
23712391
# process the unit information
23722392
if len(xranges):

0 commit comments

Comments
 (0)