From 63f46e9779222d0918ae92f400dc6be44c61790c Mon Sep 17 00:00:00 2001 From: maluethi Date: Mon, 5 Sep 2016 16:25:24 +0100 Subject: [PATCH 1/2] DOC change axhspan to numpydoc format --- lib/matplotlib/axes/_axes.py | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 0cba4d225e3..b866e0d9bf6 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -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 @@ -816,22 +809,33 @@ 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:: - - >>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5) + 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. - Valid kwargs are :class:`~matplotlib.patches.Polygon` properties: + Returns + ------- + Polygon : `~matplotlib.patches.Polygon` - %(Polygon)s + Other Parameters + ---------------- + kwargs : `~matplotlib.patches.Polygon` properties. - **Example:** + See Also + -------- + axvspan : Add a vertical span (rectangle) across the axes. + Examples + -------- .. plot:: mpl_examples/pylab_examples/axhspan_demo.py """ From 97a0e65f5ddef622a277fdb4a6943dbf7809bf83 Mon Sep 17 00:00:00 2001 From: matthias Date: Wed, 7 Sep 2016 06:49:43 +0200 Subject: [PATCH 2/2] DOC Add a Polygon reference under other parameters which was lost during conversion to numpy doc. --- lib/matplotlib/axes/_axes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index b866e0d9bf6..89293b16252 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -830,6 +830,8 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs): ---------------- kwargs : `~matplotlib.patches.Polygon` properties. + %(Polygon)s + See Also -------- axvspan : Add a vertical span (rectangle) across the axes.