猫史档案馆


【Python作品分享】v .28print plt【教程贴】

用户:1X11X1查看:0 回复:1 评论:0 创建时间:2019-10-19T20:21:09


【作品展示】

center_image

 

【作品介绍】

this is my first made to data sxso iam excited than hope you enjoy it

by 1x1 apple work shop

 

【作品源代码】

import matplotlib.pyplot as plt
print("made by apple")
print("please write 'food phone book entertainment other 's rules to make the pyplot")

jan=input("please write january plt:").split()
feb=input( "please write febuary plt:").split()
for j in range(len(jan)):
    jan[j]=int(jan[j])
for f in range(len(feb)):
    feb[f]=int(feb[f])
    
name_list=["Food","Phone","Book","Entertainment","other"]
ind=list(range(len(jan)))

plt.bar(ind,jan,width=0.3,label="January")

for i in range(len(ind)):
    ind[i]=ind[i]+0.3

plt.bar(ind,feb,width=0.3,label="Febuary")

plt.xticks(ind,name_list)
plt.xlabel("Expense Type")
plt.ylabel("Pay Expenses")
plt.legend(loc='upper left')
plt.show()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
居然有个高手居然有个高手

this is very job for data

by apple work shop

点赞1


评论