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

Skip to content

improve Axes.broken_barh docstring #10159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 38 additions & 18 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2340,33 +2340,53 @@ def barh(self, *args, **kwargs):
@docstring.dedent_interpd
def broken_barh(self, xranges, yrange, **kwargs):
"""
Plot horizontal bars.
Plot a horizontal sequence of rectangles.

A collection of horizontal bars spanning *yrange* with a sequence of
*xranges*.
A rectangle is drawn for each element of *xranges*. All rectangles
have the same vertical position and size defined by *yrange*.

Required arguments:
This is a convenience function for instantiating a
`.BrokenBarHCollection`, adding it to the axes and autoscaling the
view.

========= ==============================
Argument Description
========= ==============================
*xranges* sequence of (*xmin*, *xwidth*)
*yrange* sequence of (*ymin*, *ywidth*)
========= ==============================
Parameters
----------
xranges : sequence of tuples (*xmin*, *xwidth*)
The x-positions and extends of the rectangles. For each tuple
(*xmin*, *xwidth*) a rectangle is drawn from *xmin* to *xmin* +
*xwidth*.
yranges : (*ymin*, *ymax*)
The y-position and extend for all the rectangles.

kwargs are
:class:`matplotlib.collections.BrokenBarHCollection`
properties:
Other Parameters
----------------
**kwargs : :class:`~.BrokenBarHCollection` properties

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

facecolors='black'

%(BrokenBarHCollection)s
or a sequence of arguments over which is cycled, e.g.::

these can either be a single argument, i.e.,::
facecolors=('black', 'blue')

facecolors = 'black'
would create interleaving black and blue rectangles.

or a sequence of arguments for the various bars, i.e.,::
Supported keywords:

%(BrokenBarHCollection)s

Returns
-------
:class:`matplotlib.collections.BrokenBarHCollection`

Notes
-----
..
[Empty notes is a workaround to prevent the data note from being
injected into the Returns section.]

facecolors = ('black', 'red', 'green')
"""
# process the unit information
if len(xranges):
Expand Down