我的Python代码是:values=[234,64,54,10,0,1,0,9,2,1,7,7]months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']colors=['yellowgreen','red','gold','lightskyblue','white','lightcoral','blue','pink','darkgreen','yellow','grey','violet','magenta','cyan']plt.pie(values,labels=labels
我想创建一个matplotlib饼图,其中每个楔形的值都写在楔形的顶部。documentation建议我应该使用autopct来执行此操作。autopct:[None|formatstring|formatfunction]IfnotNone,isastringorfunctionusedtolabelthewedgeswiththeirnumericvalue.Thelabelwillbeplacedinsidethewedge.Ifitisaformatstring,thelabelwillbefmt%pct.Ifitisafunction,itwillbecalled.很遗憾,我