Answer the question
In order to leave comments, you need to log in
How to exclude the appearance of black color in the chart?
I build pie charts using the following code:
for k in range(4):
plt.figure(figsize=(10,10))
plt.pie(counts[k], labels = tags[k], autopct = '%1.1f%%', pctdistance = 0.8, shadow=False)
plt.title('Topic ' + str(k + 1) + ':')
plt.show()
Answer the question
In order to leave comments, you need to log in
You can set the colors yourself, as written in the documentation :
pie(x, explode=None, labels=None,
colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
autopct=None, pctdistance=0.6, shadow=False,
labeldistance=1.1, startangle=None, radius=None,
counterclock=True, wedgeprops=None, textprops=None)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question