2024年4月3日

import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['font.sans-serif']=['SimHei']
y=np.array([29665,3135.4,4292.4,5240.4,5543.4,5633.8,6414.5,9308.1,10353])
title=np.array(['童装','奶粉辅食','孕妈专区','洗护喂养','宝宝尿裤','春夏新品','童车童床','玩具文娱','童鞋'])
plt.figure(dpi=100,figsize=(10,8))
plt.pie(y,autopct='%.2f%%')
plt.legend(title,loc='upper right',ncol=2)
plt.title('拼多多平台子类目的销售额')
plt.table(cellText=[y],colWidths=[0.1]*9,rowLabels=['单位:亿元'],colLabels=title,loc='lower center')
plt.show()


import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
kinds=['面粉','全麦粉','酵母','苹果酱','鸡蛋','黄油','盐','白糖']
weight=[250,150,4,250,50,30,4,20]
total_weight=0
for i in weight:
    total_weight+=i
batching_scale=[i/total_weight for i in weight]
plt.pie(batching_scale,autopct='%3.1f%%')
plt.legend(kinds,loc='upper right',bbox_to_anchor=[1.1,1.1])
plt.table(cellText=[weight],cellLoc='center',rowLabels=['重量(g)'],colLabels=kinds,loc='lower center')
plt.show()


import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
x=np.arange(1,8)
y=np.array([10770,16780,24440,30920,37670,48200,57270])
bar_rects=plt.bar(x,y,tick_label=["FY2013","FY2014","FY2015","FY2016","FY2017","FY2018","FY2019"],width=0.5)
def autolabel(rects):
    for rect in rects:
        height=rect.get_height()
        plt.text(rect.get_x()+rect.get_width()/2,height+300,s='{}'.format(height),ha='center',va='bottom')
autolabel(bar_rects)
plt.ylabel('GMV(亿元)')
plt.show()

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值