2020-03-12
阅读量:
784
python:如何画一个饼图并显示百分比
np.random.seed(56)
x = [3, 5, 6, 8]
plt.figure(figsize=(8, 6), dpi=90)
plt.pie(x,
labels = ['数据库', 'PowerBI', 'Python', 'Hive'],
autopct="%.2f %%", # 显示占比的数字
explode=[0, 0, 0.1, 0],
colors = [plt.cm.tab20(i) for i in np.random.rand(4)]
);
plt.title('数据分析技能饼图', loc='left');







评论(0)


暂无数据
推荐帖子
0条评论
0条评论
3条评论