Closed aminnj closed 4 years ago
Minimal reproducer
import matplotlib.pyplot as plt
centers = [0.5, 1.5, 2.5, 3.5]
edges = [0., 1., 2., 3., 4.]
counts1 = counts2 = [5., 4., 3., 2.]
fig, axs = plt.subplots(3, sharex=True)
for ax, histtype in zip(axs.flat, ["bar", "stepfilled", "step"]):
ax.hist(centers, edges, weights=counts1, histtype=histtype)
ax.hist(centers, edges, weights=counts2, bottom=counts1, histtype=histtype)
I updated to matplotlib 3.3.1 and this issue is gone. Looks like it was fixed upstream!
utils.plot_stack
is essentiallywhich gives a weird result for the first bin (
Hist1D.plot()
useshisttype="stepfilled"
by default): however, when specifyinghisttype="bar"
, the issue is not present: Essentially it boils down to the difference in behavior between pairs of lines: