8000 added the round function to calculate accurate result · matplotlib/matplotlib@f56d915 · GitHub
[go: up one dir, main page]

Skip to content

Commit f56d915

Browse files
committed
added the round function to calculate accurate result
1 parent ef1f8c9 commit f56d915

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/pie_and_polar_charts/pie_and_donut_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444

4545
def func(pct, allvals):
46-
absolute = int(pct/100.*np.sum(allvals))
46+
absolute = int(round(pct/100.*np.sum 46FB (allvals)))
4747
return "{:.1f}%\n({:d} g)".format(pct, absolute)
4848

4949

0 commit comments

Comments
 (0)
0