matplotlib的基本绘图
1.饼图
plt.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体
# 设置绘画的主题风格
# plt.style.use('ggplot')
plt.figure(figsize=(10,5))
# 构造数据
edu = [0.2515,0.3724,0.3336,0.0368,0.0057]
labels = ['中专','大专','本科','硕士','其他']
explode = [0,0.1,0,0,0] # 用于突出大专
colors=['#F
原创
2022-01-02 20:48:37 ·
943 阅读 ·
0 评论