Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4384062

Browse files
authored
Merge pull request #25955 from anntzer/hd
Update performance note of hist() to mention stairs().
2 parents c1cf159 + 869318b commit 4384062

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6700,12 +6700,15 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
67006700
--------
67016701
hist2d : 2D histogram with rectangular bins
67026702
hexbin : 2D histogram with hexagonal bins
6703+
stairs : Plot a pre-computed histogram
6704+
bar : Plot a pre-computed histogram
67036705
67046706
Notes
67056707
-----
6706-
For large numbers of bins (>1000), plotting can be significantly faster
6707-
if *histtype* is set to 'step' or 'stepfilled' rather than 'bar' or
6708-
'barstacked'.
6708+
For large numbers of bins (>1000), plotting can be significantly
6709+
accelerated by using `~.Axes.stairs` to plot a pre-computed histogram
6710+
(``plt.stairs(*np.histogram(data))``), or by setting *histtype* to
6711+
'step' or 'stepfilled' rather than 'bar' or 'barstacked'.
67096712
"""
67106713
# Avoid shadowing the builtin.
67116714
bin_range = range

0 commit comments

Comments
 (0)