Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 580e1e3 commit a1dbd55Copy full SHA for a1dbd55
1 file changed
lib/matplotlib/stackplot.py
@@ -92,7 +92,9 @@ def stackplot(axes, x, *args, **kwargs):
92
center = np.zeros(n)
93
total = np.sum(y, 0)
94
# multiply by 1/total (or zero) to avoid infinities in the division:
95
- inv_total = np.where(total > 0, 1./total, 0)
+ inv_total = np.zeros_like(total)
96
+ mask = total > 0
97
+ inv_total[mask] = 1.0 / total[mask]
98
increase = np.hstack((y[:, 0:1], np.diff(y)))
99
below_size = total - stack
100
below_size += 0.5 * y
0 commit comments