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 932dd88

Browse filesBrowse files
committed
Fixed bug when stacking histograms with non-integer weights. Also updated hist in pyplot.py to use proper call signature
1 parent edfe3c2 commit 932dd88
Copy full SHA for 932dd88

File tree

Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed

‎lib/matplotlib/axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8072,7 +8072,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
80728072
# so that each histogram uses the same bins
80738073
m, bins = np.histogram(x[i], bins, weights=w[i], **hist_kwargs)
80748074
if mlast is None:
8075-
mlast = np.zeros(len(bins)-1, np.int)
8075+
mlast = np.zeros(len(bins)-1, np.float)
80768076
if normed:
80778077
db = np.diff(bins)
80788078
m = (m.astype(float) / db) / m.sum()

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,7 @@ def hist(x, bins=10, range=None, normed=False, weights=None, cumulative=False,
26542654
weights=weights, cumulative=cumulative, bottom=bottom,
26552655
histtype=histtype, align=align, orientation=orientation,
26562656
rwidth=rwidth, log=log, color=color, label=label,
2657-
**kwargs)
2657+
stacked=stacked, **kwargs)
26582658
draw_if_interactive()
26592659
finally:
26602660
ax.hold(washold)

0 commit comments

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