Skip to content

DOC change axhspan to numpydoc format #7037

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 2 commits into from
Sep 9, 2016
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
40 changes: 23 additions & 17 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,13 +801,6 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
"""
Add a horizontal span (rectangle) across the axis.

Call signature::

axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)

*y* coords are in data units and *x* coords are in axes (relative
0-1) units.

Draw a horizontal span (rectangle) from *ymin* to *ymax*.
With the default values of *xmin* = 0 and *xmax* = 1, this
always spans the xrange, regardless of the xlim settings, even
Expand All @@ -816,22 +809,35 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
0.5=middle, 1.0=right but the *y* location is in data
coordinates.

Return value is a :class:`matplotlib.patches.Polygon`
instance.

Examples:

* draw a gray rectangle from *y* = 0.25-0.75 that spans the
horizontal extent of the axes::
Parameters
----------
ymin : float
Lower limit of the horizontal span in data units.
ymax : float
Upper limit of the horizontal span in data units.
xmin : float, optional, default: 0
Lower limit of the vertical span in axes (relative
0-1) units.
xmax : float, optional, default: 1
Upper limit of the vertical span in axes (relative
0-1) units.

>>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
Returns
-------
Polygon : `~matplotlib.patches.Polygon`

Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:
Other Parameters
----------------
kwargs : `~matplotlib.patches.Polygon` properties.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been moved to the section "Other parameters".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the general line (i.e., kwargs), but not this substitution of all the keyword arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the list reference got lost during the conversion process. I fixed this in the new commit.


%(Polygon)s

**Example:**
See Also
--------
axvspan : Add a vertical span (rectangle) across the axes.

Examples
--------
.. plot:: mpl_examples/pylab_examples/axhspan_demo.py

"""
Expand Down