8000 Fixed bug when stacking histograms with non-integer weights. Also upd… · matplotlib/matplotlib@932dd88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 932dd88

Browse 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

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/axes.py

Lines 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

Lines 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