我正在使用pandas plot函数绘制饼图,并使用以下代码和matplotlib:
plt.figure(figsize=(16,8))
# plot chart
ax1 = plt.subplot(121, aspect='equal')
dfhelp.plot(kind='pie', y = 'Prozentuale Gesamt', ax=ax1, autopct='%1.1f%%',
startangle=90, shadow=False, labels=dfhelp['Anzahl Geschäfte in der Gruppe'], legend = False, fontsize=14)
plt.show
输出如下所示:
问题是,百分比和图例是重叠的,你有办法解决吗?对于绘图,我使用了这个question
在我看来,这是this answer的一个更容易阅读的版本(但要归功于这个答案使之成为可能)
相关问题 更多 >
编程相关推荐