Python线性图关于Convid-19 in Shanghai

import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import warnings

warnings.filterwarnings("ignore")
x = ["3/26","3/27","3/28","3/29","3/30","3/31",
     "4/1","4/2","4/3","4/4","4/5","4/6","4/7","4/8","4/9","4/10",
     "4/11","4/12","4/13","4/14","4/15","4/16","4/17","4/18","4/19","4/20",
     "4/21","4/22","4/23","4/24","4/25","4/26","4/27","4/28","4/29","4/30"]
y1 = [45, 50, 96, 326, 355, 358,
      260, 438, 425, 268, 311, 322, 827, 1015, 1006, 814,
      994, 1189, 2573, 3200, 3590, 3238, 2417, 3084, 2494, 2634,
      1931, 2736, 1401, 2472, 1661, 1606, 1292, 1292, 5487, 1249]
y2 = [2631, 3450, 4381, 5656, 5289, 4144,
      6051,7788, 8581, 13086, 16766, 19660, 20398, 22609, 23937, 25713,
      22348, 25141, 25161,19872, 19923, 21582, 19831, 17332, 16407, 15861,
      15698, 20634, 19657, 16983, 15319, 11956, 9330, 9330, 9545, 8932]

plt.figure(figsize=(15, 5))
plt.plot(x, y1, label='A')
plt.plot(x, y2, label='B')
plt.title('Convid-19 in Shanghai')
plt.xlabel('Date')
plt.ylabel('Amount')
plt.legend(fontsize=10)
plt.show()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值