我正在根据matplotlib-demo创建一个饼图:https://matplotlib.org/1.2.1/examples/pylab_examples/pie_demo.html
每个的百分比frac似乎是自动标记的.如何用绝对值替换饼图上绘制的这些自动标记的相对值(%)fracs[]?
我希望我使用 matplotlib 创建的饼图显示实际值而不仅仅是百分比。这是我的代码:
pie_shares= [i for i in mean.values()]
positions = [i for i in mean.keys()]
plt.pie(pie_shares,labels=positions, autopct='%1.1f%%', )
plt.show()
Run Code Online (Sandbox Code Playgroud)