Repository navigation
improve docstring of Axes.step - #10276
Conversation
542a427 to
3c93379
Compare
tacaswell
left a comment
There was a problem hiding this comment.
two minor comments, not going to block merging over either.
| interscection point and extend the filled region up to this point. | ||
|
|
||
| step : {'pre', 'post', 'mid'}, optional | ||
| step : [ 'pre' | 'post' | 'mid' ], optional |
There was a problem hiding this comment.
The way this was is the numpydoc specified way of listing enumerated values, I think we should be moving to that style and away from the [ | ] style (unless I have missed something.
There was a problem hiding this comment.
Is this consensus? The documentation guide is still using [ | ] in its examples.
There was a problem hiding this comment.
I'd say it should be updated then.
|
|
||
| Call signatures:: | ||
|
|
||
| plot(x, y, [fmt], data=None, where='pre', **kwargs) |
There was a problem hiding this comment.
data should probably go after kwargs as it is a keyword-only argument.
There was a problem hiding this comment.
But that might look odd, since the **kwargs form has to be at the end when one actually calls a function. I would put data after where, since data is more generic, but I wouldn't put it after **kwargs
There was a problem hiding this comment.
In 3.6 you can put keywords after kwargs :)
In [5]: def foo(**kwargs): print(kwargs)
In [6]: foo(**{'a': 'a', 'b': 'b'}, c='c')
{'a': 'a', 'b': 'b', 'c': 'c'}There was a problem hiding this comment.
That'd be a bit awkward. AFAIK, explicit arguments are not allowed after **kwargs in a signature (try def f(**kw, a=None)). I can switch to the Python 3 syntax plot(x, y, [fmt], *, data=None, where='pre', **kwargs).
3c93379 to
abdf672
Compare
abdf672 to
311ae7f
Compare
| Call signatures:: | ||
|
|
||
| plot(x, y, [fmt], *, data=None, where='pre', **kwargs) | ||
| plot(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs) |
|
|
||
| data : indexable object, optional | ||
| An object with labelled data. If given, provide the label names to | ||
| plot in x and y. |
| - 'post': The y value is continued constantly to the right from | ||
| every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the | ||
| value ``y[i]``. | ||
| - 'mid': Steps occur in the half-way between the *x* positions. |
| - 'mid': Steps occur in the middle between the *x* positions. | ||
| every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the | ||
| value ``y[i]``. | ||
| - 'mid': Steps occur in the half-way between the *x* positions. |
| interscection point and extend the filled region up to this point. | ||
|
|
||
| step : {'pre', 'post', 'mid'}, optional | ||
| step : [ 'pre', 'post', 'mid' ], optional |
| - 'post': The y value is continued constantly to the right from | ||
| every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the | ||
| value ``y[i]``. | ||
| - 'mid': Steps occur in the half-way between the *x* positions. |
311ae7f to
b3fa851
Compare
PR Summary
As part of #10148: Docstring update for
Axes.step.