# Pie chart, where the slices will be ordered and plotted counter-clockwise:
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
fig1, ax1 = plt.subplots()
patches, texts, autotexts = ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90)
for i, p in enumerate(patches):
p.set_alpha(0.25*i)
plt.show()
因为没有代码,不太清楚你的实际情况,不过下列有一些例子,是有设罝了alpha值
polar_bar_demo.py 使用 bar.set_alpha(...)
matplotlib.patches.Patch 使用 fc=(0, 0, 1, 0.5)
基本上是找对象设alpha值如XXX.set_aplha()或传参数定facecolor fc值时给四位tuple。
见代码
patches/wedges set_alpha就可以了。
更多范例见:Wedge