我的CSV文件看起来像一个在图片中,我有积多年来为国家首批非洲death_rate容易使用的代码绘制多个图形使用matplotlib
from matplotlib import pyplot
import csv
f = open('000003.csv')
data = list(csv.reader(f))[0:3]
year = [i[1] for i in data[1::]]
africa_neonatal_mortality = [i[2] for i in data[1::]]
pyplot.plot(year, death rate,'r')
pyplot.title('death rate vs Year')
pyplot.xlabel('Years')
pyplot.ylabel('death rate')
pyplot.show()
我想要的东西做的是绘制所有国家的死亡率和出生率图。我被卡住了!
那么我是一个初学者python,任何帮助将不胜感激。
我想它可以都在一个命令,像'pyplot.plot(year,death rate,'r',year,birth_rate,'bs ')'。然后,您可以根据需要修改其他详细信息,例如title和xlabel。 – deaspo