Closed
Description
The example with the "Labeling a pie and a donut" with the funcion :
def func(pct, allvals):
absolute = int(pct/100.*np.sum(allvals))
return "{:.1f}%\n({:d} g)".format(pct, absolute)
see the link:
https://matplotlib.org/3.1.1/gallery/pie_and_polar_charts/pie_and_donut_labels.html#sphx-glr-gallery-pie-and-polar-charts-pie-and-donut-labels-py
I'v found out that given a list of 1000 numbers you lose about 3% of the counts because the of the absolute, I think if you use round it will solve the problem: "absolute = int(round(pct/100.*np.sum(allvals)))