import matplotlib.pyplot as plt
year=[]
pop=[]
year=[1950,1970,1990,2010]+year
pop=[2.159,3.692,5.263,6.972]+pop
# plt.plot(year,pop)# X 列 和Y 列
plt.fill_between(year,pop,0,color="green")#圈出一块区域
plt.xlabel("Year")#X坐标
plt.ylabel("Population")#Y坐标
plt.title("World Population")#标题
plt.yticks([0,2,4,6,8],["0","2B","4B","6B","8B"])#刻度 表示是以万亿作为单位的
plt.show()
year=[]
pop=[]
year=[1950,1970,1990,2010]+year
pop=[2.159,3.692,5.263,6.972]+pop
# plt.plot(year,pop)# X 列 和Y 列
plt.fill_between(year,pop,0,color="green")#圈出一块区域
plt.xlabel("Year")#X坐标
plt.ylabel("Population")#Y坐标
plt.title("World Population")#标题
plt.yticks([0,2,4,6,8],["0","2B","4B","6B","8B"])#刻度 表示是以万亿作为单位的
plt.show()