Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5ddd807

Browse filesBrowse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #25955: Update performance note of hist() to mention stairs().
1 parent c20e16e commit 5ddd807
Copy full SHA for 5ddd807

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6669,12 +6669,15 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
66696669
--------
66706670
hist2d : 2D histogram with rectangular bins
66716671
hexbin : 2D histogram with hexagonal bins
6672+
stairs : Plot a pre-computed histogram
6673+
bar : Plot a pre-computed histogram
66726674
66736675
Notes
66746676
-----
6675-
For large numbers of bins (>1000), plotting can be significantly faster
6676-
if *histtype* is set to 'step' or 'stepfilled' rather than 'bar' or
6677-
'barstacked'.
6677+
For large numbers of bins (>1000), plotting can be significantly
6678+
accelerated by using `~.Axes.stairs` to plot a pre-computed histogram
6679+
(``plt.stairs(*np.histogram(data))``), or by setting *histtype* to
6680+
'step' or 'stepfilled' rather than 'bar' or 'barstacked'.
66786681
"""
66796682
# Avoid shadowing the builtin.
66806683
bin_range = range

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.