Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd2a95f

Browse files
authored
Merge pull request #18585 from adimalhotra11/my-feature
FIx precision in pie and donut example
2 parents 5173cda + f56d915 commit fd2a95f

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(allvals)))
4747
return "{:.1f}%\n({:d} g)".format(pct, absolute)
4848

4949

0 commit comments

Comments
 (0)