-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving plt.hist documentation #3084
Improving plt.hist documentation #3084
Conversation
@@ -5388,6 +5388,11 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, | |||
------- | |||
tuple : ``(n, bins, patches)`` or \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove these lines.
👍 - I would merge this. @tacaswell? |
@@ -5386,8 +5386,13 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, | |||
|
|||
Returns | |||
------- | |||
tuple : ``(n, bins, patches)`` or \ | |||
``([n0, n1, ...], bins, [patches0, patches1,...])`` | |||
n : array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be 'array or list of arrays', the latter is if you call hist
with `hist([data1, data2, ...])
I had not though of that, as far as I am aware bins should always be a single array of the bin edges. |
You should also add a note about how the list elements map to the input. While you are working on this documentation could you also update the input docs to state that you can pass in |
Okay @tacaswell. For the
Is it okay to leave out the shape of the return from the |
This is the cost of writing 'simple' functions that 'just work'. I would say something like '(n,) array or sequence of (n,) arrays' |
Adds a description of the return value of
plot.hist()
. Suggested by tcaswell in this SO post. I have tried my best to stick to the numpy doc format but admit I was confused as to if this should go in thereturn
statement or the extended description at the top of the docstring.