ziheng - 学习统计图

import matplotlib.pyplot as plt
# math 数学 plot画画   library 图书管     py

# 数据:1。编    2。找别人的数据    3。自己生产数据
# 一元一次方程
# x - 8 = 12 ===> x-8-12 = 0
# x*x + 8*x + 4 = 0
x = []
y = []
daan = []
for i in range(0, 100):
    x.append(i)
    y.append(i-20 )
    daan.append(0)

print(x)
print(y)
# y = x-18-12
# 画图,折线图
# plt.plot(x, y)
# plt.plot(x,daan)
# 条形图  bar 柱子
# plt.bar(x,y)
# 饼图/扇形图  pie
x = [20,30,50]
plt.pie(x)


plt.show()





发布了613 篇原创文章 · 获赞 21 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/houlaos/article/details/105573493