看帖神器
未名空间
追帖动态
头条新闻
每日新帖
最新热帖
新闻存档
热帖存档
文学城
虎扑论坛
未名空间
北美华人网
北美微论坛
看帖神器
登录
← 下载
《看帖神器》官方
iOS App
,体验轻松追帖。
plot
查看未名空间今日新帖
最新回复:2020年2月15日 22点26分 PT
共 (3) 楼
返回列表
订阅追帖
只看未读
更多选项
阅读全帖
只看图片
只看视频
查看原帖
c
chebyshev
大约 4 年
楼主 (未名空间)
import numpy as np
import pylab
import matplotlib.pyplot as plt
#https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
coronavirus_outbreak#Case_statistics
x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,11791,14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
63851,66492,68500]
#b1^2 = 2
b1 = 2**(0.5)
#b2^6 = 2
b2 = 2**(1.0/6.0)
#b3^6 = 3
b3 = 2**(1.0/3.0)
a1 = [x[0]*pow(b1, i) for i in range(len(x))]
a3= [x[0]*pow(b2, i) for i in range(len(x))]
a2= [x[0]*pow(b3, i) for i in range(len(x))]
x = np.asarray(x)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
line, = ax.plot(x,'o', color='red', lw=4,label="confirmed cases")
line, = ax.plot(a1,'-', color='blue', lw=1,label="doubled each two days")
line, = ax.plot(a2,'-', color='blue', lw=1,label="doubled each three days")
line, = ax.plot(a3,'-', color='blue', lw=1,label="doubled each six days")
ax.legend()
ax.set_yscale('log')
pylab.show()
c
chebyshev
大约 4 年
2 楼
Sigapore
【 在 chebyshev (......) 的大作中提到: 】
: import numpy as np
: import pylab
: import matplotlib.pyplot as plt
: #https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
: coronavirus_outbreak#Case_statistics
: x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,
11791,
: 14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
: 63851,66492,68500]
: #b1^2 = 2
: b1 = 2**(0.5)
: ...................
c
chebyshev
大约 4 年
3 楼
recovered
【 在 chebyshev (......) 的大作中提到: 】
: import numpy as np
: import pylab
: import matplotlib.pyplot as plt
: #https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
: coronavirus_outbreak#Case_statistics
: x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,
11791,
: 14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
: 63851,66492,68500]
: #b1^2 = 2
: b1 = 2**(0.5)
: ...................
请输入帖子链接
收藏帖子
import numpy as np
import pylab
import matplotlib.pyplot as plt
#https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
coronavirus_outbreak#Case_statistics
x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,11791,14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
63851,66492,68500]
#b1^2 = 2
b1 = 2**(0.5)
#b2^6 = 2
b2 = 2**(1.0/6.0)
#b3^6 = 3
b3 = 2**(1.0/3.0)
a1 = [x[0]*pow(b1, i) for i in range(len(x))]
a3= [x[0]*pow(b2, i) for i in range(len(x))]
a2= [x[0]*pow(b3, i) for i in range(len(x))]
x = np.asarray(x)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
line, = ax.plot(x,'o', color='red', lw=4,label="confirmed cases")
line, = ax.plot(a1,'-', color='blue', lw=1,label="doubled each two days")
line, = ax.plot(a2,'-', color='blue', lw=1,label="doubled each three days")
line, = ax.plot(a3,'-', color='blue', lw=1,label="doubled each six days")
ax.legend()
ax.set_yscale('log')
pylab.show()
Sigapore
【 在 chebyshev (......) 的大作中提到: 】
: import numpy as np
: import pylab
: import matplotlib.pyplot as plt
: #https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
: coronavirus_outbreak#Case_statistics
: x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,
11791,
: 14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
: 63851,66492,68500]
: #b1^2 = 2
: b1 = 2**(0.5)
: ...................
recovered
【 在 chebyshev (......) 的大作中提到: 】
: import numpy as np
: import pylab
: import matplotlib.pyplot as plt
: #https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
: coronavirus_outbreak#Case_statistics
: x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,
11791,
: 14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
: 63851,66492,68500]
: #b1^2 = 2
: b1 = 2**(0.5)
: ...................