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