-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update performance note of hist() to mention stairs(). #25955
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
Conversation
@@ -6700,12 +6700,14 @@ def hist(self, x, bins=None, range=None, density=False, weights=None, | |||
-------- | |||
hist2d : 2D histogram with rectangular bins | |||
hexbin : 2D histogram with hexagonal bins | |||
stairs : Plot a pre-computed histogram |
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.
Can you also add bar since we also recommend bar Y the top for plotting precomputed histograms?
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.
done
lib/matplotlib/axes/_axes.py
Outdated
For large numbers of bins (>1000), plotting can be significantly | ||
accelerated by setting *histtype* to 'step' or 'stepfilled' rather | ||
than 'bar' or 'barstacked', or by using `~.Axes.stairs` to plot a | ||
pre-computed histogram (``plt.stairs(*np.histogram(data))``). | ||
""" |
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.
For large numbers of bins (>1000), plotting can be significantly | |
accelerated by setting *histtype* to 'step' or 'stepfilled' rather | |
than 'bar' or 'barstacked', or by using `~.Axes.stairs` to plot a | |
pre-computed histogram (``plt.stairs(*np.histogram(data))``). | |
""" | |
For large numbers of bins (>1000), plotting can be significantly | |
accelerated by using `~.Axes.stairs` to plot a | |
pre-computed histogram (``plt.stairs(*np.histogram(data))``) or by setting *histtype* to 'step' or 'stepfilled' rather | |
than 'bar' or 'barstacked'. | |
""" |
'rather than' makes the histtype part of the sentence more complex so I think it's easier to parse if it's at the end.
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.
done
…ntion stairs().
…955-on-v3.7.x Backport PR #25955 on branch v3.7.x (Update performance note of hist() to mention stairs().)
PR summary
PR checklist