假设,我有一个饼图如下;我想根据向量中的一些值为切片着色,作为蓝色到红色之间的渐变。蓝色为-1,红色为+1,没有大于1也没有小于-1的值。
fracs = [33,33,33]
starting_angle = 90
axis('equal')
patches, texts, autotexts = pie(fracs, labels = None, autopct='%1.1f%%', startangle=90)
print patches[2]
for item in autotexts:
item.set_text("")
subplots_adjust(left=0.125, bottom=0.1, right=0.9, top=0.9, wspace=0.0, hspace=-0.4)
savefig('/home/superiois/Downloads/projectx3/GRAIL/pie2')
show()