【发布时间】:2015-03-20 12:27:56
【问题描述】:
我正在 matplotlib 中绘制一些饼图,我的一些图表上的百分比标签相互重叠,看起来很乱。有没有办法改变文本的位置,所以它都是可读的? 下面是我得到的示例-“其他”和“ALD2_OH”类别重叠且不可读。
我的绘图代码在这里:
matplotlib.rcParams.update({'font.size': 18})
plt.figure(figsize=(11,11))
labels = ['ALD2 + OH','PAN + $therm$','ALD2 + NO$_3$','ATOOH + $hv$',
'Others',]
colours = ['BlueViolet','DarkMagenta','DarkOrchid','DarkViolet','Purple'
]
patches, texts,autotexts = plt.pie(main_producers, labels=labels, colors = colours,
autopct='%1.1f%%', startangle = 90)
plt.title('Contribution to MCO$_3$ yeild')
希望有人能帮忙!
谢谢
【问题讨论】:
标签: python matplotlib label pie-chart