import matplotlib.pyplot as plt
# 数据
dates = ['2022-01', '2022-02', '2022-03', '2022-04', '2022-05', '2022-06', '2022-07', '2022-08', '2022-09', '2022-10', '2022-11', '2022-12']
confirmed_cases = [275995, 275995, 275995, 275995, 275995, 275995, 275995, 275995, 275995, 275995, 275995, 275995] # 假设确诊人数
deaths = [14262, 14262, 14262, 14262, 14262, 14262, 14262, 14262, 14262, 14262, 14262, 14262] # 假设死亡人数
recovered = [211238, 211238, 211238, 211238, 211238, 211238, 211238, 211238, 211238, 211238, 211238, 211238] # 假设治愈人数
# 创建图形
plt.figure(figsize=(10, 6))
# 绘制确诊、死亡和治愈曲线
plt.plot(dates, confirmed_cases, marker='o', label='确诊人数', color='blue')
plt.plot(dates, deaths, marker='o', label='死亡人数', color='red')
plt.plot(dates, recovered, marker='o', label='治愈人数', color='green')
# 添加标题和标签
plt.title('2022年全国疫情统计图')
plt.xlabel('日期')
plt.ylabel('人数')
plt.xticks(rotation=45)
plt.legend()
plt.grid()
# 显示图形
plt.tight_layout()
plt.show()