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

Skip to content

Commit 0522695

Browse files
committed
StepPatch and stairs() docstring improvements.
1 parent 1e19aa8 commit 0522695

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6744,24 +6744,27 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
67446744
def stairs(self, values, edges=None, *,
67456745
orientation='vertical', baseline=0, fill=False, **kwargs):
67466746
"""
6747-
A histogram-like line or filled plot.
6747+
A stepwise constant line or filled plot.
67486748
67496749
Parameters
67506750
----------
67516751
values : array-like
6752-
An array of y-values.
6752+
The step heights.
67536753
6754-
edges : array-like, default: ``range(len(vals)+1)``
6755-
A array of x-values, with ``len(edges) == len(vals) + 1``,
6754+
edges : array-like
6755+
The edge positions, with ``len(edges) == len(vals) + 1``,
67566756
between which the curve takes on vals values.
67576757
67586758
orientation : {'vertical', 'horizontal'}, default: 'vertical'
6759+
The direction of the steps. Vertical means that *values* are along
6760+
the y-axis, and edges are along the x-axis.
67596761
67606762
baseline : float or None, default: 0
67616763
Determines starting value of the bounding edges or when
67626764
``fill=True``, position of lower edge.
67636765
67646766
fill : bool, default: False
6767+
Whether the area under the step curve should be filled.
67656768
67666769
Returns
67676770
-------

lib/matplotlib/patches.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,11 @@ def set_path(self, path):
990990

991991

992992
class StepPatch(PathPatch):
993-
"""An unclosed step path patch."""
993+
"""
994+
A path patch describing a stepwise constant function.
995+
996+
The path is unclosed. It starts and stops at baseline.
997+
"""
994998

995999
@docstring.dedent_interpd
9961000
def __init__(self, values, edges, *,
@@ -999,13 +1003,15 @@ def __init__(self, values, edges, *,
9991003
Parameters
10001004
----------
10011005
values : array-like
1002-
An array of y-values.
1006+
The step heights.
10031007
10041008
edges : array-like
1005-
A array of x-value edges, with ``len(edges) == len(vals) + 1``,
1009+
The edge positions, with ``len(edges) == len(vals) + 1``,
10061010
between which the curve takes on vals values.
10071011
10081012
orientation : {'vertical', 'horizontal'}, default: 'vertical'
1013+
The direction of the steps. Vertical means that *values* are along
1014+
the y-axis, and edges are along the x-axis.
10091015
10101016
baseline : float or None, default: 0
10111017
Determines starting value of the bounding edges or when

0 commit comments

Comments
 (0)