2015-01-12 67 views

回答

8

pyplot.pie documentation

返回值:

如果autopct不是沒有,返回元組(補丁,文本,autotexts), 其中補丁和文本如上,和autotexts是列表 數字標籤的文本實例。

您需要更改顏色autotexts;這是由set_color()做簡單:

_, _, autotexts = pie(fbfrac,labels = fblabel,autopct='%1.1f%%',pctdistance=0.8,startangle=90,colors=fbcolor) 
for autotext in autotexts: 
    autotext.set_color('white') 

這個收益率(與Hogs and Dogs example): enter image description here

+0

謝謝!完美工作 – Jsuf

相關問題