@@ -1930,37 +1930,63 @@ def step(self, x, y, *args, **kwargs):
1930
1930
"""
1931
1931
Make a step plot.
1932
1932
1933
+ Call signatures::
1934
+
1935
+ plot(x, y, [fmt], *, data=None, where='pre', **kwargs)
1936
+ plot(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)
1937
+
1938
+ This is just a thin wrapper around `.plot` which changes some
1939
+ formatting options. Most of the concepts and parameters of plot can be
1940
+ used here as well.
1941
+
1933
1942
Parameters
1934
1943
----------
1935
1944
x : array_like
1936
- 1-D sequence, and it is assumed, but not checked,
1937
- that it is uniformly increasing.
1945
+ 1-D sequence of x positions. It is assumed, but not checked, that
1946
+ it is uniformly increasing.
1938
1947
1939
1948
y : array_like
1940
- 1-D sequence.
1949
+ 1-D sequence of y levels.
1950
+
1951
+ fmt : str, optional
1952
+ A format string, e.g. 'g' for a green line. See `.plot` for a more
1953
+ detailed description.
1954
+
1955
+ Note: While full format strings are accepted, it is recommended to
1956
+ only specify the color. Line styles are currently ignored (use
1957
+ the keyword argument *linestyle* instead). Markers are accepted
1958
+ and plotted on the given positions, however, this is a rarely
1959
+ needed feature for step plots.
1960
+
1961
+ data : indexable object, optional
1962
+ An object with labelled data. If given, provide the label names to
1963
+ plot in x and y.
1964
+
1965
+ where : {'pre', 'post', 'mid'}, optional, default 'pre'
1966
+ Define where the steps should be placed:
1967
+
1968
+ - 'pre': The y value is continued constantly to the left from
1969
+ every *x* position, i.e. the interval ``(x[i-1], x[i]]`` has the
1970
+ value ``y[i]``.
1971
+ - 'post': The y value is continued constantly to the right from
1972
+ every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the
1973
+ value ``y[i]``.
1974
+ - 'mid': Steps occur in the half-way between the *x* positions.
1941
1975
1942
1976
Returns
1943
1977
-------
1944
- list
1945
- List of lines that were added .
1978
+ lines
1979
+ A list of `.Line2D` objects representing the plotted data .
1946
1980
1947
1981
Other Parameters
1948
1982
----------------
1949
- where : [ 'pre' | 'post' | 'mid' ]
1950
- If 'pre' (the default), the interval from
1951
- ``x[i]`` to ``x[i+1]`` has level ``y[i+1]``.
1952
-
1953
- If 'post', that interval has level ``y[i]``.
1954
-
1955
- If 'mid', the jumps in *y* occur half-way between the
1956
- *x*-values.
1983
+ **kwargs
1984
+ Additional parameters are the same as those for `.plot`.
1957
1985
1958
1986
Notes
1959
1987
-----
1960
- Additional parameters are the same as those for
1961
- :func:`~matplotlib.pyplot.plot`.
1988
+ .. [notes section required to get data note injection right]
1962
1989
"""
1963
-
1964
1990
where = kwargs .pop ('where' , 'pre' )
1965
1991
if where not in ('pre' , 'post' , 'mid' ):
1966
1992
raise ValueError ("'where' argument to step must be "
@@ -4997,10 +5023,12 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
4997
5023
step will occur:
4998
5024
4999
5025
- 'pre': The y value is continued constantly to the left from
5000
- every *x* position.
5026
+ every *x* position, i.e. the interval ``(x[i-1], x[i]]`` has the
5027
+ value ``y[i]``.
5001
5028
- 'post': The y value is continued constantly to the right from
5002
- every *x* position.
5003
- - 'mid': Steps occur in the middle between the *x* positions.
5029
+ every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the
5030
+ value ``y[i]``.
5031
+ - 'mid': Steps occur in the half-way between the *x* positions.
5004
5032
5005
5033
Other Parameters
5006
5034
----------------
@@ -5173,16 +5201,18 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
5173
5201
Setting *interpolate* to *True* will calculate the actual
5174
5202
interscection point and extend the filled region up to this point.
5175
5203
5176
- step : { 'pre', 'post', 'mid'} , optional
5204
+ step : [ 'pre', 'post', 'mid' ] , optional
5177
5205
Define *step* if the filling should be a step function,
5178
5206
i.e. constant in between *y*. The value determines where the
5179
5207
step will occur:
5180
5208
5181
- - 'pre': The y value is continued constantly below every *y*
5182
- position.
5183
- - 'post': The y value is continued constantly above every *y*
5184
- position.
5185
- - 'mid': Steps occur in the middle between the *y* positions.
5209
+ - 'pre': The y value is continued constantly to the left from
5210
+ every *x* position, i.e. the interval ``(x[i-1], x[i]]`` has the
5211
+ value ``y[i]``.
5212
+ - 'post': The y value is continued constantly to the right from
5213
+ every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the
5214
+ value ``y[i]``.
5215
+ - 'mid': Steps occur in the half-way between the *x* positions.
5186
5216
5187
5217
Other Parameters
5188
5218
----------------
0 commit comments