使用matplotlib在python中绘制多个图形

2024-06-26 00:06:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我的CSV文件看起来像图片中的一个,我已经绘制了非洲第一个容易使用代码的国家的死亡率

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的初学者,任何帮助都将不胜感激。在

enter image description here


Tags: 文件csvinimportfordatarate绘制