1.please compare figure 1 and figure 2
2 How to change text color on Pie chart ?
(If fragment of Pie chart is black text is unreadable )
3. Text "0.5%" in figure 2 is unreadable, how correct this?
( i try use pctdistance= 1.1 but if value is format autopct='%1.4f%%' some text is unreadable )
#!/usr/bin/env python
from pylab import *
# make a square figure and axes
figure(1, figsize=(8,8))
ax = axes([0.1, 0.1, 0.8, 0.8])
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
fracs = [50,25,24.5, 0.5]
figure(1)
pie(fracs, labels=labels)
legend( loc='best', shadow=True)
# figure(2) show a some optional features. autopct is used to label
# the percentage of the pie, and can be a format string or a function
# which takes a percentage and returns a string. explode is a
# len(fracs) sequence which gives the fraction of the radius to
# offset that slice.
figure(2, figsize=(8,8))
explode=(0, 0.05, 0, 0)
pie(fracs, explode=explode, labels=labels, autopct='%1.1f%%', shadow=True)
legend( loc='best', shadow=True)
savefig('pie_demo')
show()